0

I have maven project required dependencies in my local, I need to create an executable jar without dependency and need to use those dependencies in my local during the runtime, instead of packing it along with the project. how to create a maven project jar without dependency in eclipse and how to execute that jar feeding the local location where the dependencies exist?

chanskar
  • 1
  • 1
  • might be answered already in [how-can-i-create-an-executable-jar-with-dependencies-using-maven](https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – Michael Hauptmann Jul 11 '20 at 17:10

1 Answers1

0

You can use mvn dependency:build-classpath to generate the necessary classpath to run your jar

https://maven.apache.org/plugins/maven-dependency-plugin/build-classpath-mojo.html

and then run your jar with java and adding the generated classpath as -cp argument.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142