Search code examples
mavenmaven-surefire-pluginmaven-failsafe-plugin

User property to skip running tests but still compile them in Surefire 3.x


The Maven Surefire Plugin documentation says I can use the skipTests user property to keep from running tests, but still compile them. However it says that this approach is deprecated and will be removed in Failsafe 3.0.0.

There is also a maven.test.skip user property, but this bypasses compiling tests altogether.

So what user property am I supposed to use in Surefire 3.x if I want to compile tests and but run them? Note that my question is about setting a user property in the Maven POM, not a Java system property I specify on the command line. Is this capability being removed altogether from Surefire 3.x?

Note that the Maven Failsafe Plugin still has a skipITs user property which is not deprecated, and which compiles integration tests but does not run them.


Solution

  • Since Surefire and Failsafe are quite similar this is also mentioned in Surefire's doc. However:

    will be removed in Failsafe 3.0.0

    shouldn't affect Surefire.