1.

How can you skip running the tests for a particular project?

Answer»

Set the skipTests attribute to true to skip the tests for a certain project.

<groupId>org.apache.maven.plugins</groupId><artifactId>maven-SUREFIRE-PLUGIN</artifactId><version>2.13.0</version><configuration> <skipTests>true</skipTests></configuration>

You MAY also skip the tests by using the following command from the command line:

mvn INSTALL -DskipTests

You can also use the maven.test.skip option to avoid compiling the tests if you have to. Surefire, Failsafe, and the Compiler Plugin all recognize maven.test.skip.

mvn install -Dmaven.test.skip=true

You must go through a properties section in the pom if you want to skip tests by default but have the possibility to re-enable tests from the command line:

<properties> <skipTests>true</skipTests></properties>

And,

<groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>2.13.0</version><configuration> <skipTests>${skipTests}</skipTests></configuration>


This will allow you to run tests with the default tests disabled and EXECUTE them with the following command:

mvn install -DskipTests=false

The "skip" parameter and other booleans on the plugin can be used in the same way.



Discussion

No Comment Found