IMO you should use the assembly:single plugin...assembly:assembly and
assembly:attached both have some weird side effects related to the
fact that they're aggregator mojos, where the assembly:single plugin
is just that:
an assembly mojo for use in a single project within a build (even if
that build is a multimodule build with multiple assembly:single
bindings, this will work cleanly, where the assembly:attached call
may not).
HTH,
-john
On Sep 2, 2007, at 10:01 AM, Brian E. Fox wrote:
You need to change the goal to "attached" if you want this to run
inside
your build. The assembly goal forks the build and causes everything to
run twice.
-----Original Message-----
From: Will Pugh [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 02, 2007 12:45 AM
To: [email protected]
Subject: Unit tests being run twice when using assembly
Hi,
I would like to be able to create a Jar, that has all it's
dependencies
in it (and has a MainClass set in the manifest). I can get this to
work
using the assembly plugin, but the problem is that it causes my unit
tests to all get run twice. This is causing our builds to take way
longer than they should.
The way I'm currently doing this, is to add the snippet at the
bottom to
my POM.
I've also tried this with using the minijar-maven-plugin, but with the
same affect. Is there a way for me to have my project only build a
jar
with the dependencies in it? Or is there a way to have my assembly
not
have to have an entire rebuild/retest before building the new
assembly?
Thanks,
--Will
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assembly/with-dependencies.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>my.main.class</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<id>make-standalone</id>
<goals>
<goal>assembly</goal>
</goals>
</execution>
</executions>
</plugin>
---------------------------------------------------------------------
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]
---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john