Fork me on GitHub
#tools-deps
<
2020-05-14
>
fabrao00:05:28

hello all, is there any way to exclude dependency of a lib in deps.edn ?

Alex Miller (Clojure team)00:05:12

you can use :exclusions [lib/name] in a coordinate

Alex Miller (Clojure team)00:05:00

I'm assuming you're talking about a transitive dependency

Alex Miller (Clojure team)00:05:10

there is no global exclusions right now

fabrao00:05:36

Hello Alex, I´m doing this

{:paths ["src"]
 :deps {org.clojure/clojure {:mvn/version "1.10.1"}

        mount {:mvn/version "0.1.16"}
        com.sikulix/sikulixapi {:mvn/version "2.0.4"
                                :exclusions [org.bouncycastle/bctsp-jdk14]}}}
and still getting
clj -J'-Dclojure.server.repl={:port,5555,:accept,clojure.core.server/repl}'
Error building classpath. Could not find artifact bouncycastle:bctsp-jdk14:jar:138 in central ()

fabrao00:05:44

what is maybe wrong?

Alex Miller (Clojure team)00:05:15

not sure, that seems like good deps syntax

Alex Miller (Clojure team)00:05:19

that 138 looks suspicious to me

fabrao00:05:49

so, excluding is not an option for this?

Alex Miller (Clojure team)00:05:51

which is an actual version - I assume that's in com.sikulix/sikulixapi deps

Alex Miller (Clojure team)00:05:11

might be an edge case where it's failing while getting the metadata for something that it's going to exclude

Alex Miller (Clojure team)00:05:33

I am getting on a call, but I can look at it tomorrow

fabrao00:05:57

oh, ok, thanks

fabrao00:05:13

I´ll try with lein

seancorfield00:05:04

@fabrao apparently what you want to exclude is bouncycastle/bctsp-jdk14 (without the org.)

seancorfield00:05:20

I noticed in the initial set of download messages:

Downloading: org/jboss/logging/jboss-logging/3.1.4.GA/jboss-logging-3.1.4.GA.pom from central
Downloading: org/jboss/jboss-parent/9/jboss-parent-9.pom from central
Downloading: bouncycastle/bctsp-jdk14/138/bctsp-jdk14-138.pom from central <======== LOOK AT THIS LINE!
Downloading: org/bouncycastle/bctsp-jdk14/1.38/bctsp-jdk14-1.38.pom from central
Downloading: org/ghost4j/ghost4j/1.0.1/ghost4j-1.0.1.jar from central

fabrao00:05:48

@seancorfield You are the BOSS !!! That´s it !!! Thank you

seancorfield00:05:21

(which looks ancient and maybe even bogus?)

Alex Miller (Clojure team)00:05:42

yeah, that must be old or something

Alex Miller (Clojure team)00:05:05

in case you're wondering the path to badness is com.sikulix/sikulixapi 2.0.4 net.sourceforge.tess4j/tess4j 4.4.1 org.ghost4j/ghost4j 1.0.1 com.lowagie/itext 2.1.7 bouncycastle/bcprov-jdk14 138

Alex Miller (Clojure team)00:05:31

there are newer versions of stuff lower down, didn't investigate in detail but probably could update some stuff to newer there to fix

fabrao01:05:07

I could use with excludes like Sean said, thanks

Andreas Edvardsson07:05:35

I have added a plain java class alongside my clojure code. Is it possible to have it compiled as a part of the ordinary clojure compilation? In lein there seems to be a :java-source-paths option, is there something corresponding in tools.deps?

just.sultanov19:05:31

I use this solution. If you want you can use something like this: https://gist.github.com/just-sultanov/e2f61734e22e2ed3981216ed9b880bc0

plexus07:05:04

not in tools.deps. Some of the build tools based on tools.deps can do it though. Or you may be able to get away with compiling them manually, e.g.

for x in **/*.java; do javac -cp `clojure -Spath` $x ; done

Andreas Edvardsson08:05:24

Thanks for the answer! The class is expected to be more or less static, so just a manual javac invocation indeed seems to be the simplest solution. :)

bringe22:05:00

Hi, I'm a bit new to the clojure command line tools. I'm wondering if there is an equivalent to lein deps and this is because I'm using it with docker. It is recommended with docker to download dependencies in a separate step so that they aren't re-downloaded if none changed, such as:

FROM clojure
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY project.clj /usr/src/app/
RUN lein deps
COPY . /usr/src/app
RUN mv "$(lein uberjar | sed -n 's/^Created \(.*standalone\.jar\)/\1/p')" app-standalone.jar
CMD ["java", "-jar", "app-standalone.jar"]

Alex Miller (Clojure team)22:05:33

you can do clj -e nil to trigger deps to resolve and download

bringe22:05:44

Ahhh thanks!

deactivateduser22:05:03

Yeah I had a need for this recently (in a TravisCI build), and ended up doing clojure -Srepro -e '(println "Dependencies downloaded")'. Felt a bit hackish, but glad to see that’s basically how it’s done.

👍 4
deactivateduser22:05:05

I stand corrected - it was a GitHub action/workflow thingy - but basically the same idea.