I\'ve set up a build on Jenkins for a Maven project, and I would like to build it without running any of the tests. I\'ve tried entering \"clean install -DskipTests\" in the go
use "Goals and options" value is "clean install -DskipTests=true".
it works like a Charm. I saved hours of time using this Option. :-)
I use option "-DskipTests=true" in "Invoke top-level Maven target" -> "JVM Options" and it works fine.
Just to extend the answer, maven has 2 options for skipping tests:
-DskipTests=true
— The one that was mentioned. With this parameter, maven ignores tests completely.
-Dmaven.test.skip=true
— With this option maven compiles the tests but doesn't launch them.
So you may want to use the second option instead as fast code compile validation. E.G.: if you develop some library or module that will be used by some one else you must be sure that you don't brake contract with the client. Tests compilation can help you with this.
Use either of these parameters depending on your needs.
The problem is that I omitted =true
. I was able to build without running tests by entering:
clean install -DskipTests=true