简体   繁体   中英

Adding all jars from a Nexus repo to Leiningen dependencies list

I want to add all jars from the local Nexus repo to a Leiningen :dependencies list. I've added the Nexus repo to the :repositories list in project.clj . Is there any way to add all jars to :dependencies , instead of specifying them one by one?

Thanks!

pom to project

"Java project's lib folder contains lots of jars"

Does this Java project fetch these jars directly from nexus repo (eg via pom.xml ), because it should.

And if it does, and you just don't want to manually craft project.clj with all these dependencies, you can use something like lein-nevam to convert it to project.clj to start you off.

less dependency, more independency

Does the Clojure library really need all these Java project's dependencies though? Or just a subset of them? As I mentioned in comments, it is always best to narrow down the number of dependencies due to many reasons: code collision, transitive dependencies, version management, compatibility, etc.. rather thаn to "just include them all"

In order to use Nexus you just have to configure Leiningen to use Nexus as the repository. Then you can specify all your dependencies as usual but they will be retrieved from Nexus. This can include components from Central, clojars and any other repo you want to add to the public group.

More details are in the Nexus book chapter about tool confi g and especially the Leiningen section .

If you then specifiy the dependencies you need in your library (and only those) and publish to Nexus with a pom that specifies these any Java project that uses Maven or Gradle or whatever to build can consume your library and will also get the correct transitive dependencies. Same is if your code was eg, created with Maven and written in Java.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM