I'm trying to reduce the size of an executable jar file by
elimintating it's junit jar file when it is assembled.
I thought this could be accomplished by simply specifying
<scope>test</scope> in the junit dependency in the parent pom, but
when looking at the assembled jar file contents, junit is present.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
I thought when I executed
mvn clean package assembly:assembly
I'd get the assembled executable jar file with no junit component.
Here's the assembly-descriptor.xml:
<assembly>
<id>package</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<moduleSets>
<moduleSet>
<includes>
<include>module a</include>
<include>module b</include>
</includes>
<binaries>
<outputDirectory>/</outputDirectory>
<includeDependencies>true</includeDependencies>
<unpack>true</unpack>
</binaries>
</moduleSet>
</moduleSets>
</assembly>
Next I tried adding an <excludes> descriptor to the
assembly-descriptors.xml file like this:
<dependencySets>
<dependencySet>
<excludes>
<exclude>junit:junit</exclude>
</excludes>
</dependencySet>
</dependencySets>
In all cases, junit appears in he resulting assembled jar.
What am I doing wrong?
Thanks in advance.
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]