This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-16
Channels
- # announcements (19)
- # babashka (41)
- # beginners (9)
- # calva (1)
- # cider (28)
- # clerk (2)
- # clj-kondo (33)
- # cljs-dev (1)
- # clojars (32)
- # clojure (29)
- # clojure-europe (36)
- # clojure-nl (1)
- # clojure-norway (10)
- # clojure-uk (4)
- # clojurescript (33)
- # datahike (6)
- # datomic (44)
- # emacs (35)
- # fulcro (25)
- # hyperfiddle (22)
- # introduce-yourself (1)
- # java (11)
- # kaocha (7)
- # membrane (3)
- # off-topic (2)
- # pathom (7)
- # polylith (15)
- # portal (3)
- # squint (1)
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 ( )
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?
There's no application, but does the name of the jar itself matter?
Apparently, yes. I would sort of expected deps-deploy to handle that renaming for you...
oh so the jar should be named quadtree-cljc-0.1.3.jar then ?
That should work, yes. You'll have to deploy 0.1.4 now, but...
No wait, let me check one of my projects...
https://github.com/seancorfield/next-jdbc/blob/develop/build.clj#L55 -- yeah, lib-version.jar
(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
)
the maven deploy plugin renames the jar to this format
But deps-deploy
does not, it seems.
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
This is for Clojars -- so maybe that's why there's no renaming?
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).ah so it is the jar name then
(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)
(so I guess that's why there is no renaming here -- because <artifact>-<classifier>-<version>.jar
is perfectly reasonalbe)
@U064X3EF3 yes, a mistake. 😅
https://repo.clojars.org/com/janetacarr/quadtree-cljc/0.1.0/ has the only version that would work directly -- without -standalone
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)
@U04V70XH6 that's funny because 0.1.0 is the only version built with your build-clj lib haha
Sane defaults 🙂
This is why https://clojure-doc.org/articles/cookbooks/cli_build_projects/ exists now instead 🙂
@U064X3EF3 that'd be nice.
I have half reading the cookbook haha
I wonder how clojars / deps-deploy should handle multiple artifacts with classifiers...? Although that's a question for a different thread I guess 🙂
I think I have a blog post to update somewheres.... Anyways thanks to the both of you!
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
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)
> 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.