views:

211

answers:

3

I have a multi-module project and want to create a single jar containing the classes of all my modules. Inside my parent POM, I declared the following plugin:

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-assembly-plugin</artifactId>
 <configuration>
  <descriptorRefs>
   <descriptorRef>bin</descriptorRef>
  </descriptorRefs>
 </configuration>
</plugin>

However, when running mvn assembly:assembly, only the source from the parent folder (empty) are included. How do I include the sources from my modules into the archive?

A: 

The predefined bin won't do the trick here. You'll have to use a custom descriptor similar to the predefined bin descriptor but that declares moduleSet to include your project modules.

Pascal Thivent
A: 

I think you are looking for the Maven Shade Plugin:

http://maven.apache.org/plugins/maven-shade-plugin/index.html

Packages up any number of dependencies into an uber package depenency. This can then be deployed to a repository.

Lincoln