Yes, I just realized that this is important. The version I'm using is v2.1.
<plugin>
                                <artifactId>maven-assembly-plugin</artifactId>
                                <version>2.1</version>

If I left out the <version> tag, the assembly:assembly goal did not
produce an executable jar. I was unable to get the assembly to work
unless I specified v2.1 explicitely. However, I notice that many of
the assembly features are not available unless I specify 2.2.

Kind of a "catch 22".

...But are you able to get rid of the junit folder? Can you pass me
some examples?

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]

Reply via email to