How to make maven plugin release skip tests?

I run mvn release:prepare -Darguments="-Dmaven.test.skip=true -DskipTests" in the Spotify docker-client master control. But I can not get the maven release plugin to skip tests. Why, in this case, maven does not respect the CLI flags?

I am also wondering what makes the release plugin execute the surefire plugin. There is no pom.xml plugin specified in pom.xml .

 mvn --version Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T12:29:23-05:00) Maven home: /usr/local/Cellar/maven/3.2.5/libexec Java version: 1.7.0_25, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/jre Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.10.2", arch: "x86_64", family: "mac" 
+6
source share
2 answers

There are two things. First, if you like to run the release, you need to run mvn release:perform , which really launches the step for the final version, not mvn release:prepare . If you want to skip tests in mvn release:prepare , you should use mvn -Dmaven.test.skip=true plus the arguments you specified.

In addition, the maven-surefire-plugin is defined in the standard life cycle.

+1
source

It worked for me. I wanted to prepare as well as complete the release.

 mvn clean -DskipTests -Darguments=-DskipTests release:prepare release:perform 
+27
source

Source: https://habr.com/ru/post/983543/


All Articles