Fork me on GitHub
#clojars
<
2024-01-16
>
Janet A. Carr00:01:26

I'm not sure if I'm doing something wrong, but I just deployed a jar to clojars but I keep getting this error but the jar exists on clojars https://clojars.org/com.janetacarr/quadtree-cljc. All I did for this version was add a license via (write-pom {:pom-data...}) in my build.clj

Error building classpath. Could not find artifact com.janetacarr:quadtree-cljc:jar:0.1.3 in central ()

seancorfield00:01:59

https://repo.clojars.org/com/janetacarr/quadtree-cljc/0.1.3/ -- looks like you uploaded the -standalone JAR which would be the application, rather than the library JAR?

Janet A. Carr00:01:46

There's no application, but does the name of the jar itself matter?

seancorfield00:01:48

Apparently, yes. I would sort of expected deps-deploy to handle that renaming for you...

Janet A. Carr00:01:54

oh so the jar should be named quadtree-cljc-0.1.3.jar then ?

seancorfield00:01:02

That should work, yes. You'll have to deploy 0.1.4 now, but...

seancorfield00:01:20

No wait, let me check one of my projects...

seancorfield00:01:07

(although in my case that path ends up being target/com.github.seancorfield/next.jdbc-1.3.909.jar -- but the trailing part is artifactID-version.jar)

Alex Miller (Clojure team)00:01:43

the maven deploy plugin renames the jar to this format

seancorfield00:01:07

But deps-deploy does not, it seems.

Alex Miller (Clojure team)00:01:18

or maybe it's nexus that renames it, I guess I'm not sure where that happens exactly, but when it ends up in the repo it has to follow the repo naming conventions to be found

seancorfield00:01:58

This is for Clojars -- so maybe that's why there's no renaming?

seancorfield00:01:26

This does work by the way:

clojure -Sdeps '{:deps {com.janetacarr/quadtree-cljc$standalone {:mvn/version "0.1.3"}}}'
by virtue of how classifiers work (`$thing` maps to -thing in your JAR file name).

Janet A. Carr00:01:01

ah so it is the jar name then

Alex Miller (Clojure team)00:01:19

(this is orthogonal, but I notice there is an older 0.1.14 version - maybe a typo when deployed, and by Maven version comparison rules that will look newer than 0.1.3 or 0.1.4)

seancorfield00:01:33

(so I guess that's why there is no renaming here -- because <artifact>-<classifier>-<version>.jar is perfectly reasonalbe)

Janet A. Carr00:01:16

@U064X3EF3 yes, a mistake. 😅

seancorfield00:01:33

https://repo.clojars.org/com/janetacarr/quadtree-cljc/0.1.0/ has the only version that would work directly -- without -standalone

Alex Miller (Clojure team)00:01:46

when you do a maven deploy you either tell it coords or give it a pom that has them - it will write the jar to the place according to those coords. I guess maybe the clojars upload doesn't do the same when publishing

Alex Miller (Clojure team)00:01:35

seems like that would be a good thing for clojars to at least validate (coords match the artifact name)

Janet A. Carr00:01:54

@U04V70XH6 that's funny because 0.1.0 is the only version built with your build-clj lib haha

seancorfield00:01:07

Sane defaults 🙂

Janet A. Carr00:01:21

I have half reading the cookbook haha

seancorfield00:01:07

I wonder how clojars / deps-deploy should handle multiple artifacts with classifiers...? Although that's a question for a different thread I guess 🙂

Janet A. Carr00:01:14

@U064X3EF3 @U04V70XH6 that was the problem. 0.1.4 works 🙂

2
Janet A. Carr00:01:49

I think I have a blog post to update somewheres.... Anyways thanks to the both of you!

seancorfield01:01:14

I'll add a note to http://clojure-doc.org and also chat to Erik about deps-deploy helping prevent this. https://github.com/clojure-doc/clojure-doc.github.io/issues/68

🙌 2
Alex Miller (Clojure team)01:01:15

multiple artifacts with different classifiers all share the same pom and usually they are uploaded as part of the same deployment (with normal maven deploy plugin)

tcrawley12:01:18

> when you do a maven deploy you either tell it coords or give it a pom that has them - it will write the jar to the place according to those coords. I guess maybe the clojars upload doesn't do the same when publishing > seems like that would be a good thing for clojars to at least validate (coords match the artifact name) Clojars does verify that the version, group, and artifact name you are trying to deploy (via the path) matches what is in the pom. It doesn't parse the version from the jar file name to confirm that though. Did you see an example where there was a mismatch? I didn't see a mismatch in any version of this project. And I think Clojars did the right thing here otherwise unless it should be invalid to deploy a classified jar without a non-classified one.