InterviewSolution
| 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 -DskipTestsYou 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=trueYou 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>
The "skip" parameter and other booleans on the plugin can be used in the same way. |
|