I'm new to maven and have got a project with some dependencies. Now Maven should create a jar file of all /src/main/java
files and put them into a directory A
. I want to achieve these things in the build process :
B
C
.I've got that working with ANT but I want to do a clean port to Maven and not invoke the big ANT file.
Can someone point me in the right direction? Which plugins should I use?
First, have look at Maven Assembly Plugin. It might satisfy all your needs. I have used it but just little bit so I can just point you to information that you might need.
You create XML configuration file for this plugin called Assembly Descriptor that guides its operation.
There are some predefined available on the page of the plugin. http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html At least the one with sources in zip will help you.
Assembly description is on http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html.
In case that Maven Assembly plugin won't handle all the thing you need, you can use: - Maven Copy Plugin - http://evgeny-goldin.com/wiki/Maven-copy-plugin to copy source files - Maven Dependency Plugin -http://maven.apache.org/plugins/maven-dependency-plugin/ for copy of all dependency JARs (goal copy-dependencies of the plugin) - Maven Resources plugin http://maven.apache.org/plugins/maven-resources-plugin/ - if resources are what you need to copy.