I have a maven project where I am using the assembly plugin.
I typically create my artifacts by running:
mvn clean verify assembly:assembly
(I have integration tests which I want run separately to unit tests).
When this runs, the assembly plugin is running the unit tests itself.
This causes them to be run twice.
Is there a way I can tell the assembly plugin not to run the tests?
I am tempted to run this in two steps:
1. mvn clean verify
2. if previous command successful, run mvn assembly:assembly -DskipTests=true
However, this is a little clumsy and would rather the single command.
Thanks,
Steven
The
assembly:assemblygoal Invokes the execution of the lifecycle phase package prior to executing itself and running it on the command line will thus invoke any phase prior topackage. And this includes thetestphase.No. My suggestion would be to create the assembly as part of the build lifecycle instead of invoking the plugin on the command line i.e. to bind it on a particular phase. For example:
And if you don’t want the assembly to be created if your integration tests fail, then bind it on a later phase (e.g.
post-integration-testorverify).And if you don’t want the assembly to be systematically created, put the above configuration in a profile.