tools-deps

janezj 2023-04-08T09:34:02.670279Z

I want to bring an old java project into clojure. The project depends on a lot of jars in ./lib folder. So I created script to write all localroot entries, because is close to impossible to convert local deps to maven central deps. But I suspect that even for :local/root transitive dependencies are processed. Is there a way to ignore pom.xml in local jar? For example axiom-impl/axiom-impl {:local/root "./lib/axiom-impl-1.2.10.jar"} clojure -Stree axiom-impl/axiom-impl /home/jj/workspace/rpt/lib/axiom-impl-1.2.10.jar . http://org.apache.ws.commons.axiom/axiom-api 1.2.10 . org.apache.geronimo.specs/geronimo-activation_1.1_spec 1.0.2 . org.apache.geronimo.specs/geronimo-javamail_1.4_spec 1.6 . commons-logging/commons-logging 1.1.1 . jaxen/jaxen 1.1.1 . org.apache.geronimo.specs/geronimo-stax-api_1.0_spec 1.0.1 . org.apache.geronimo.specs/geronimo-activation_1.1_spec 1.0.2 . org.apache.geronimo.specs/geronimo-javamail_1.4_spec 1.6 . org.codehaus.woodstox/wstx-asl 3.2.9 . commons-logging/commons-logging 1.1.1 . org.apache.geronimo.specs/geronimo-stax-api_1.0_spec 1.0.1 axis-adb/axis-adb {:local/root "./lib/axis2-adb-1.5.4.jar"} clojure -Stree Error building classpath. Could not find artifact wsdl4j:wsdl4j:jar:1.6.2 in central (https://mirror.example.com/nexus/content/repositories/public) there is nothing interesing in above jar in MANFEST.MF but there is META-INF/maven/org.apache.axis2/axis2-adb/pom.xml with following deps <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>axis2-kernel</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-activation_1.1_spec</artifactId> </dependency> <dependency> <groupId>xmlunit</groupId> <artifactId>xmlunit</artifactId> <scope>test</scope> </dependency> </dependencies>

Alex Miller (Clojure team) 2023-04-10T13:29:06.414299Z

if you use the proper groupId/artifactId, there will be no jar hell - the best version will be selected. since presumably all of the transitive deps are in your set of local root jars, really only they should get used, but you might see metadata resolution happen

Alex Miller (Clojure team) 2023-04-10T13:29:45.670829Z

you can add additional maven repos with :mvn/repos {"repoId" {:url "...repo-url..."}} in the top of the deps.edn

Alex Miller (Clojure team) 2023-04-10T13:30:40.457749Z

if you could make a question at https://ask.clojure.org, that's a good way to register a request for a new feature on this

janezj 2023-04-09T11:48:10.945189Z

The best solution would be to use :local/dir. Many Clojurists might not be aware that :local/root is not offline and attempts to load transitive dependencies. This behavior can come as a surprise.

Alex Miller (Clojure team) 2023-04-08T16:39:33.705869Z

why do you want to ignore the transitive deps?

Alex Miller (Clojure team) 2023-04-08T16:40:05.677799Z

and yes, it is using the pom.xml in the to find those transitive deps

janezj 2023-04-08T17:15:11.394039Z

It is an old project, and part of it was delivered years ago as a folder of jars, and an example how to send some reports to a government agency. All required jars are in the folder. But some poms are for example pointing to sourceforge repos too. I don't know how to setup. And will probably create jars hell because of the duplicates. One way it would be to pack the old junk into docker, jetty and servlet webservice, and second app will be in clojure using this webservices. But I would like to do all the stuff in a single app.

janezj 2023-04-08T18:04:43.052749Z

Currently it is looking for Non-resolvable parent POM for com.sun.codemodel:codemodel:2.2-SNAPSHOT

janezj 2023-04-08T18:08:10.835349Z

Current build.gradle just collects jars, without transitive resolving and it works dependencies { compile fileTree(dir: 'lib', include: ['**/*.jar']) testCompile 'junit:junit:4.+' runtime 'com.ibm.db2.jcc:runtime_v1:11.1' compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.8.v20171121' compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.8.v20171121' compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25' }

janezj 2023-04-12T09:19:15.456589Z

With a little bit of luck and several hours I found that only one local jar is required: wsdl4j/wsdl4j. All the others are available from http://dist.wso2.org/maven2 I admit that I am not super happy, because I don't know the ws02. Thanks Alex.