how to make maven release plugin skip tests?

后端 未结 5 2014
感动是毒
感动是毒 2021-02-03 19:59

I\'m running mvn release:prepare -Darguments=\"-Dmaven.test.skip=true -DskipTests\" on the master checkout of Spotify\'s docker-client. But I can\'t get maven\'s re

5条回答
  •  执笔经年
    2021-02-03 20:39

    This is one of the first hits in google for this problem and yet doesn't have the most likely explanation and solution, so here is my attempt.

    I faced the same issue as the OP in running release:prepare with -DskipTests passed in via -Darguments not getting recognized. After digging in, I noticed that a grandparent POM (parent of the parent) has the following config:

            
              org.apache.maven.plugins
              maven-release-plugin
              2.5.2
              
                -B
              
            
    
    

    It actually has more config, but I only show what is most relevant for this problem, which is the -B. This is hardcoding the arguments configuration parameter to -B instead of letting it read the arguments property. To get around, I added the below in the project pom and it started working:

            
              org.apache.maven.plugins
              maven-release-plugin
              
                $(arguments)
              
            
    

提交回复
热议问题