Fork me on GitHub

Using Sean Corfield's fork of depstar, and running the command clj -A:uberjar x.jar, I get

Building uber jar: x.jar
{:warning "clashing jar item", :path "META-INF/services/com.fasterxml.jackson.core.JsonFactory", :strategy :concat-lines}
{:warning "clashing jar item", :path "META-INF/services/com.fasterxml.jackson.core.JsonFactory", :strategy :concat-lines}
I know it is just a warning, but what do I do to fix it? My deps.edn is
{:paths ["src"]                         ;until TDEPS-52 is fixed
  {:extra-paths ["test"]
   :extra-deps {org.clojure/test.check {:mvn/version "RELEASE"}}}
    {:git/url ""
     :sha "76568540e7f40268ad2b646110f237a60295fa3c"}}
   :main-opts ["-m" "cognitect.test-runner" "-d" "test"]}}
  cheshire {:mvn/version "5.10.0"}
  http-kit {:mvn/version "2.3.0"}
  org.clojure/clojure {:mvn/version "1.10.1"}
If this is not the appropriate channel, please redirect me. Thanks.


You don't do anything to fix it. It's just warning you, so you know that the same file is being copied into your JAR multiple times (and it is handling it by concatenating the files). Jackson is a horribly problematic library -- it is the cause of most of the version conflicts we see people run into these days but unfortunately it's also fairly ubiquitous so...


I'm a bit surprised you're seeing the message twice -- that implies three copies of the file are being found on the classpaths...


The 1.0.x version of depstar (currently on master) will have a -S / --suppress-clash option to hide that warning message(!) but you can currently use the -v / --verbose option to learn more about what it is bringing in @dorab


OK, I've repro'd based on your deps.edn and it looks like each of the three Jackson libraries being pulled in by Cheshire all contain that same file.


Yup, seems like each of the Jackson JAR files (core, databind-cbor, and databind-smile) all contain that file and it has a class name in it that matches one in the library it comes from. I'm fairly certain this is harmless and "expected behavior". Perhaps @ghadi can confirm when he is next around, since he's the original author of the first version of depstar...?


(this seems like another reason to try using instead of cheshire 🙂 )


Thanks @seancorfield. I will try to use instead.


If the same file is being requested multiple times, could depstar just include it once? Sorry if I'm being naive.


No, the same named file is included in three different libraries.


As I said above, Cheshire pulls in Jackson, and that means you get its core, cbor, and smile libs (dataformat, not databind, my bad -- rest of it still applies). Each of those three libs includes the same file. depstar concatenates the lines in each file to create a single file in the resulting JAR.


Gotit. Thanks.


Interestingly, dataformat-smile and dataformat-cbor are both deprecated and archived. Ah, looks like dataformat-binary is the replacement for both of those now. Sheesh, that is one weird, troublesome library...


Hello all, how to convert this lein uberjar

:main ^:skip-aot app.core
  :uberjar-name "project.jar"
  :profiles {:uberjar {:aot :all}}


to deps.end alias?


It has an example in the readme

# generate pom.xml (or create it manually)
clojure -Spom
# build the uberjar with AOT compilation
clojure -A:depstar -m hf.depstar.uberjar MyProject.jar -C -m project.core
# Main-Class: project.core
java -jar MyProject.jar


(use project.jar instead of MyProject.jar and app.core instead of project.core)


You'll need to edit the pom.xml generated by clojure -Spom to add more stuff. Take a look at a pom.xml file generated by clj-new (if you created your project with a recent version of clj-new and the app template, then the pom.xml file will probably be almost 100% of what you would need for depstar and deployment to Clojars anyway).


@seancorfield I tried -A:uberjar from your dot-clojure but I didn´t know about pom.xml


so I creat project.clj to generate jar