JUnit tests not getting skipped on Jenkins when -DskipTests argument is passed

I have one Jenkins job configured to build Maven project. I have to skip tests for some reason so I am trying to skip tests using -DskipTests argument but somehow its not working.

Is there any other way to skip JUnit tests on Jenkins?

>Solution :

I was facing a similar issue. I had to add the below argument to skip JUnit tests.

-DskipTests -Darguments="-DskipTests"

It worked for me.

Leave a Reply