Previously, I thought you had to list every runtime dependency you wanted to include in a dependencySet:
<dependencySets>But all runtime dependencies can be brought into the assembly with an empty dependencySet element (runtime scope implicitly includes compile scope):
<dependencySet>
<includes>
<include>commons-dbcp:commons-dbcp</include>
…
</includes>
<outputDirectory>mule/lib/user</outputDirectory>
</dependencySet>
</dependencySets>
<dependencySet/>This will put all the runtime dependencies in the root of the assembled artifact, so you can add an outputDirectory:
<dependencySet>And in the case where you want to exclude something (such as mule-#.tar.gz or isoft-#.tar.gz) you can add exclusions:
<outputDirectory>mule/lib/user</outputDirectory>
</dependencySet>
<dependencySet>Doing things this way puts a heavier burden on properly managing your dependencies however (which really is a good thing). If transitive dependencies you may not need are not excluded in the POM’s dependency declaration or the parent’s dependencyManagement, the transitive dependencies will end up in your artifact, leading to potential collisions and jar bloat. An example of an exclusion:
<outputDirectory>mule/lib/user</outputDirectory>
<excludes>
<exclude>*:tar.gz</exclude>
</excludes>
</dependencySet>
<dependency>You can run each of the following to help with your dependency manangement:
<groupId>toplink.essentials</groupId>
<artifactId>toplink-essentials</artifactId>
<scope>runtime</scope>
<excludes>
<exclude>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
</exclude>
</excludes>
</dependency>
mvn dependency:analyze
mvn dependency:resolve
mvn dependency:tree