Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude Tests from Maven build

When I am running maven clean install it always executes all tests in src/test/java is there a way to skip all the tests, just to run simple build without any tests.

I want my tests to be in src/test/java but I want to tell maven to do not execute them. I've been looking for something like that on the internet but I did not manage to find the answer.

Is there a way to do this?

like image 492
Paulius Matulionis Avatar asked Aug 24 '12 13:08

Paulius Matulionis


People also ask

How do I skip a test in Jenkins build?

We can simply skip or ignore them. This behavior is specified in Jenkins. For a Maven project we simply set a parameter in the JVM options of our Maven configuration. This will disable or skip all of the tests in this project.

How do I skip a module in Maven build?

Maven version 3.2. 1 added this feature, you can use the -pl switch (shortcut for --projects list) with ! or - (source) to exclude certain submodules. Be careful in bash the character ! is a special character, so you either have to single quote it (like I did) or escape it with the backslash character.


1 Answers

Try with:

mvn clean install -DskipTests 

Source here.

like image 69
jelies Avatar answered Sep 19 '22 17:09

jelies