Maven Assemblies

Due to requests I received for source code for my open source file parser project (http://www.javaforge.com/project/2066), I had to quickly figure out a way to package a zip file that would contain

– source code

– binary jar file

– javadocs

– license and release-changes text files.

Since I am using Maven, I found that assemblies can come to my help. Thought I’d jot down a few things here so that others can google to it and find the same.

I created a file src/main/assemply/src.xml. This contained a list of artifacts I wanted to package as a zip. The XML should be self-explanatory.

In my pom.xml I have the following under the build section.

Once this is done, running command “mvn assembly:assembly” will trigger the build and the creation of my distributable file as target\flatfilereader-0.6-dist.zip