Search code examples
javamavenjunitmaven-3

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?


Solution

  • Try with:

    mvn clean install -DskipTests
    

    Source Maven Surefire Plugin - Skipping Tests.