Short version: I have a module in a multi-module maven build that depends on other modules in the same project. I'd like to merge all 3rd party transitive dependencies into a single .jar, but NOT include any dependencies from the project in that .jar. I can't find a way to get the assembly plugin to do this.

Long version: I have a multi-module maven build, which produces a .jar for each module (this is good). Now I'd like to merge all 3rd party dependencies into a single jar. I'm deploying my app via webstart, and the idea is that the modules of the app will change frequently, so they need to be downloaded separately, but 3rd party dependencies will not change often, and it is faster to download them all in one merged .jar via webstart. In the end, I want something like this:

 my-app-module1.jar
 my-app-module2.jar
 3rdpartylibs.jar

My master .pom includes a modules section that looks something like this:

<modules>
 <module>my-app-module1</module>
 <module>my-app-module2</module>
 <module>3rdpartylibs</module>
</modules>

The only dependencies declared by the 3rdpartylibs module are on the other two modules (my-app-module1, my-app-module2). I'd like the transitive dependency feature of maven to pick up all the other dependencies. I use the assembly plugin with the assembly definition below. The idea is that it will pick up all dependencies, including transitive, and then filter out all my project's artifacts via the <exclude>com.myGroupId:*</exclude>. Instead, it includes ALL dependencies, including the two modules (which are in the com.myGroupId group). It's as if the <exclude> was completely ignored.

<assembly>
 <id>3rd-party-dependencies</id>
 <formats>
   <format>jar</format>
 </formats>
 <includeBaseDirectory>false</includeBaseDirectory>
 <dependencySets>
   <dependencySet>
     <excludes>
       <exclude>com.myGroupId:*</exclude>
     </excludes>
     <outputDirectory>/</outputDirectory>
     <unpack>true</unpack>
     <scope>runtime</scope>
   </dependencySet>
 </dependencySets>
</assembly>

I'm new to maven, so I might be missing something here. Any help is appreciated.

Thanks,
 Andy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to