I think the Maven way is *not* to create any aggregate jar. Since Maven
manages transitive dependencies, there's rarely need for it. For those poor
souls :) who aren't yet using Maven, aggregate jars may be useful though.
You can use either Maven assembly's predefined descriptor
jar-with-dependencies (
http://maven.apache.org/plugins/maven-assembly-plugin/descriptor-refs.html#jar-with-dependencies)
or the Shade plugin to do the job (
http://maven.apache.org/plugins/maven-shade-plugin/). Depending on how you
want to invoke and organize it, you can either keep it as part of the parent
pom or have a separe sub-module just for creating this jar. A separate
sub-module is cleaner and easier to automate for releasing. I'd prefer
<project>-all name to clearly indicate to the Maven folks that they probably
shouldn't use that.

Kalle


On Wed, Mar 25, 2009 at 12:28 PM, Les Hazlewood <[email protected]>wrote:

> What is the 'maven way' for creating an aggregate .jar that includes
> everything?  I'm thinking a .jar that would include everything _except_ the
> samples.
>
> ActiveMQ does this by having a dedicated 'pom only' module called
> 'activemq-all' that wraps the other .jars.  However, Spring has a
> spring.jar
> that just includes everything (not called 'spring-all.jar').  I'm not sure
> how they do that or even if they use maven to assemble it.
>
> What is the appropriate solution?  I'd like to enable that...
>
> - Les
>

Reply via email to