I am assembling a jar-with-dependencies jar for a project with two modules.
mvn package assembly:assembly assembles the jar using the wrong jar file for
one of the modules. I believe the solution is in how I configure the
assembly descriptor to include the right jar, but this is where I'm having
trouble.

The two modules are
vodmain
vodtest

 vodtest is a test-jar packaged using the maven jar plugin, and mvn package
generatest two jar files

71122  vodtest-1.0-SNAPSHOT-tests.jar   <--- This is the file *I
want*included in the jar-with-dependencies.
  1987  vodtest-1.0-SNAPSHOT.jar           <--  This is the file that gets
included instead.

I'm creating the vodtest-1.0-SNAPSHOT-tests.jar by using the
maven-jar-plugin

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-jar</id>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>

The main pom uses the assembly-plugin to create the assembly. How do I
configure it so that it includes the test-jar :
 vodtest-1.0-SNAPSHOT-tests.jar instead of the other jar.

<assembly>
<id>jar-with-dependencies</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<includes>
<include>com.comcast.vodauto:vodmain</include>
<include>com.comcast.vodauto:vodtest</include>
</includes>
<binaries>
<outputDirectory></outputDirectory>
<includeDependencies>true</includeDependencies>
<unpack>true</unpack>
<outputFileNameMapping />
</binaries>
</moduleSet>
</moduleSets>
<dependencySets>
<dependencySet>
<outputDirectory></outputDirectory>
<outputFileNameMapping></outputFileNameMapping>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>

-- 
- Ed

Reply via email to