0

I've a 3rd part JAR which I invoke using below command:

java -jar -Dxxx=xxx xyz.jar

Now the above JAR reads conf file located in conf folder & also reads several dependency JARs located in the lib folder. The lib & conf folders are located in the place where this JAR exists.

Due to legacy reasons, I'm not allowed to modify this xyz.jar

How do I write Maven POM so that it'll run the xyz.jar by getting rid of lib folder & it'll read these libraries from repo (without updating xyz.jar)?

Jack Dorson
  • 684
  • 5
  • 4
  • Maven is a build tool primarily, not a runtime tool. So, libraries are read from Maven's repositories at build time, not at runtime. You could create a project that uses `xyz.jar` (+ its dependencies as transitive dependencies) as dependency. Have you read the [documentation](https://maven.apache.org/guides/index.html)? – Gerold Broser Nov 14 '14 at 22:50
  • possible duplicate of [How can I create an executable jar with dependencies using Maven?](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – jordiburgos Nov 14 '14 at 23:03
  • If I create the project with xyz.jar + dependent JARs as transitive JAR, what would this project do exactly? Will it create anything or how do I run maven command? – Jack Dorson Nov 14 '14 at 23:05
  • @ jordiburgos, this is not duplicate, I don't want to include dependent JARs into a single JAR. I just want to know how to make it run successfully by removing dependent JARs from lib folder to maven repo. – Jack Dorson Nov 14 '14 at 23:06
  • @JackDorson You actually DO want to include dependent JARs into a single JAR, i.e. `xyz.jar` + its dependencies. There is no other way to get rid off libraries in the lib folder _"without updating xyz.jar."_ – Gerold Broser Nov 15 '14 at 11:19
  • @Gerald In that case, which maven plugin will merge jars from lib directory into existing 3rd party xyz.jar & how to use that plugin? – Jack Dorson Nov 18 '14 at 19:33

0 Answers0