Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set in the pom to not compile tests?

How do I set in the pom to not compile tests in Maven? I've tried:

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

but in that case, Maven compile the tests but don't run them. I need Maven don't compile my tests.

like image 763
Rafael Toledo Avatar asked Apr 04 '13 21:04

Rafael Toledo


People also ask

How do you ignore test cases in Maven build?

To skip running the tests for a particular project, set the skipTests property to true. You can also skip the tests via the command line by executing the following command: mvn install -DskipTests.

Does Maven compile run tests?

Maven will compile the tests without running them.

How can you override skipTests parameter in command line?

Skipping by default by initializing the skipTests element value to true in properties and then overriding it through the command line by mentioning the value of -DskipTests in the maven phase/build execution command.


1 Answers

You have to define maven.test.skip to true.

<properties>
    <maven.test.skip>true</maven.test.skip>
</properties>

http://maven.apache.org/surefire/maven-surefire-plugin/examples/skipping-test.html

like image 62
maba Avatar answered Oct 11 '22 12:10

maba