Fork me on GitHub
#tools-deps
<
2022-02-18
>
Adam Helins12:02:08

I'm currently converting a project to use tools.build I'm getting several license conflicts when uberjaring, aren't those resolved by default?

Execution error (ExceptionInfo) at clojure.tools.build.tasks.uber/explode (uber.clj:172).
Cannot write META-INF/license/LICENSE.boringssl.txt from io.grpc/grpc-netty-shaded as parent dir is a file from another lib. One of them must be excluded.

delaguardo12:02:47

No, they don't. This most likely happens because one of your dependencies brings META-INF/license file

delaguardo12:02:58

I solve it by adding this

:exclude [#"(?i)^META-INF/license/.*"
                     #"^license/.*"]
As an option for uber function

Adam Helins12:02:54

Thanks, does the job perfectly!

Adam Helins12:02:39

(sorry for posting in the wrong channel!)

seancorfield18:02:06

We switched from grpc-netty-shaded to grpc-okhttp to avoid that license conflict -- it should be a drop-in replacement for most uses -- and it shrank our JAR files by about 10MB too, as I recall.

genekim15:11:30

Thank you to @U04V4KLKC and @U04V70XH6 — I had the same problem with this GCP library: {com.google.cloud/google-cloud-secretmanager {:mvn/version "2.3.5"}`` I’m documenting more fully the steps to fix, to help my future self and maybe others: 🙂 I wrote this build.clj that used https://github.com/seancorfield/build-clj with the following actions:

(ns build
  (:require [clojure.tools.build.api :as b]
    [org.corfield.build :as bb]))

(def lib 'genek/pubsub-web)

(defn uber2 "build uber JAR locally." [opts]
  (-> opts
    (assoc :lib lib :version version
            :exclude [#"(?i)^META-INF/license/.*"
                      #"^license/.*"])
    (bb/uber)))

Adam Helins14:02:31

Wondering about the status and urgency of https://clojure.atlassian.net/browse/CLJ-2638 Historically, I've always found the idea very useful in the context of monorepos. Now, we are in the process of merging repos at work and once again, this idea popped-in and we were agreeing it would save us from a lot of troubles.

borkdude14:02:55

Perhaps until that's there, this could be worth a look. https://github.com/exoscale/deps-modules

Alex Miller (Clojure team)14:02:48

Looks like that ticket is in the wrong place, I'll move it...

Alex Miller (Clojure team)14:02:13

don't think I'm imminently going to look at it though

seancorfield18:02:20

@UCFG3SDFV We have a pretty big monorepo at work and, to be honest, we do not find this to be an issue. What sort of alias issues are you running into?

Alex Miller (Clojure team)19:02:12

rather than answering here, it would be far more helpful to me to collect it at https://ask.clojure.org/index.php/10564/specify-an-alias-that-is-a-set-of-other-aliases

1
👍 1
Adam Helins09:02:28

I just did, hopefully I made my case clear 🙂