It's resolved, and I did not have to specify an assembly plugin version.
The key was to add an empty <outputFileNameMapping/> tag to the <binaries>
section of the <moduleSet>.
The <dependencySet> looks like this:
<dependencySet>
<outputDirectory></outputDirectory>
<outputFileNameMapping></outputFileNameMapping>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
So now the junit component is not in the assembly, i can still run
JUnit tests in eclipse, and the final assembly is executable.
Thanks,
Ed
On 4/26/07, Trevor Spackman <[EMAIL PROTECTED]> wrote:
Which version of the assembly plugin are you using? They recently
released a new version of it. I couldn't get rid of the junit folder by
the method you described so I reverted back to the last non-beta
version.
Trevor Spackman
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Ed Young
Sent: Thursday, April 26, 2007 3:02 PM
To: Maven Users List
Subject: excluding junit from assembly
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]