Fork me on GitHub
#tools-build
<
2022-06-24
>
jumar07:06:26

I'm a tools.build noob and trying to quickly build an uberjar. I followed the instructions here: https://clojure.org/guides/tools_build But when I try to build it I get this error:

clj -T:build uber
Error building classpath. Bad coordinate for library :ns-default, expected map: build
What am I doing wrong? My build.clj is here: https://github.com/jumarko/clojure-experiments/pull/5/files#diff-5e404fc7ef47dfb3139017bcd1ff83f7c1214c3f5d3f73fcde5f4ca466b59f16 (deps.edn below)

dominicm09:06:05

Your deps.edn had a misplaced }.

dominicm09:06:17

:ns-default shouldn't be part of :deps

jumar09:06:52

Ah, great catch - thanks!

Darin Douglass19:06:02

@seancorfield i’m using build-clj to build an uberjar with some git deps that i need to include. i’m using :transitive true to get the git deps into the uberjar proper. one of the git deps has a transitive dependency https://github.com/cognitect-labs/aws-api/issues/205#issuecomment-1164833972`data.xml`, so i’ve added an :exclusion. this works in the repl, etc. however that excluded dep shows up in the uberjar. i did some digging and it looks like lifted-basis doesn’t propagate exclusions from parent libs. is this intentional? (i’ve not used polylith so i’m not sure if there’s a reason hidden there somewhere)

seancorfield19:06:41

Can you create a minimal, self-contained example as a GitHub repo, and create an issue against build-clj pointing to that with complete, step-by-step instructions?

seancorfield19:06:58

I'm finding it hard to visualize what you're describing without seeing it all in code.

Darin Douglass19:06:14

ya i feel that, i’ll ping when it’s up

seancorfield19:06:38

I suspect https://github.com/seancorfield/build-clj/blob/main/src/org/corfield/build.clj#L128 should use (select-keys coords [:mvn.version :exclusions]) (and a bit of tidying up in that whole conditional -- it doesn't support :default-deps either right now, based on expecting :mvn.version to be non-`nil`.

Darin Douglass19:06:24

ya, tinkering around and using :exclusions from (:parents coords) worked locally for me

seancorfield20:06:52

OK, no need for a MSCE repo -- but please still create the issue so I don't forget (I'm deep in Java interop/rewriting ATM).

1
1
seancorfield20:06:07

@U02EA2T7FEH Could you try build-clj with :git/sha "5b86a6e7c600993cbde06133bf9c7632f2cb3a1f" (and comment out the :git/tag for now) and see if that fixes the problem?

seancorfield20:06:22

I just want to see if my supposition is correct.

Darin Douglass20:06:31

❯ jar tf target/*.jar | grep aalto
❯

Darin Douglass20:06:09

looks good to me

seancorfield20:06:44

Thank you! I'll try to get a proper updated release out "soon" but it may be next week...

Darin Douglass20:06:08

no worries, i’ve a workaround in place at the moment

seancorfield20:06:40

I may wait until there's a new tools.build version so I don't have to think about version numbers 🙂

Darin Douglass20:06:32

lol i feel that 😛