I’m trying to de-mavenize a project.
Is there a way to extract all the jars needed for this maven project to a folder?
(I’m very newbie with maven, so please; instructions provided should be in dummy mode) Thanks!
;-)
Maven's local repository is a directory on the local machine that stores all the project artifacts. When we execute a Maven build, Maven automatically downloads all the dependency jars into the local repository. Usually, this directory is named . m2.
To export your project, right-click it and select Export. Select Java > Runnable JAR file as the export destination and click Next. On the next page, specify the name and path of the JAR file to create and select the Launch configuration that includes the project name and the name of the test class.
You can use dependency:copy-dependencies goal of maven dependency plugin to achieve this.
In fact, just run mvn dependency:dependencies
on your maven project and you should find a dependencies
subfolder created under target
folder and populated with all the dependencies including transitive ones.
Take a look at maven-assembly-plugin
and its jar-with-dependencies
predefined descriptor:
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies
You can easily create own descriptor by modify this one slightly. Just set <unpack>false</unpack>
and <outputDirectory>/some-dir</outputDirectory>
.
And if you haven't used this plugin so far, read this:
http://maven.apache.org/plugins/maven-assembly-plugin/usage.html
to get what's actually going on there and how to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With