1

I have a pom file where i have added all the dependencies. and .m2 folder where i have added Jar files added

But i am looking for a file where i can just add all the dependencies in the file like and run it.

mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get
-DrepoUrl=http://download.java.net/maven/2/ -Dartifact=robo-guice:robo-guice:0.4-SNAPSHOT

So that i don't have to worry about jar files in my .m2 folder.

Is there any way to do that.

Thanks in advance.

ndeverge
  • 21,378
  • 4
  • 56
  • 85
jimmy
  • 8,121
  • 11
  • 36
  • 40
  • 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) – kdgregory Jun 30 '12 at 12:09
  • look at [Vijay's answer](http://stackoverflow.com/a/3770791/42126), which uses the shade plugin rather than the assembly plugin – kdgregory Jun 30 '12 at 12:10
  • http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/ might be solution or the http://maven.apache.org/plugins/maven-shade-plugin/ – khmarbaise Jun 30 '12 at 15:44

1 Answers1

1

You can use mvn dependency:copy-dependencies to copy all dependencies to some folder.

The other solution is to create a single JAR which contains everything. See the answers to this question: How can I create an executable JAR with dependencies using Maven?

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820