How to execute multiple goals in one maven command, but with different arguments for each goal

后端 未结 2 1974
你的背包
你的背包 2021-01-19 20:53

I am trying to run 2 maven goals in one maven command like:

mvn release:prepare release:perform -Darguments=\'-Dmaven.test.skip=true\'

but,

相关标签:
2条回答
  • 2021-01-19 21:00

    I have spent hours on this.

    My working release command is:

    -Darguments='-DskipTests=true' -DskipTests release:prepare release:perform
    

    The problem actually was in my release plugin:

    <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <arguments>${release.arguments}</arguments>
    

    The "arguments" parameter of the release plugin was overriding the -Darguments that I pass to the release:prepare (in order to be passed to release:perform by release:prepare).

    0 讨论(0)
  • 2021-01-19 21:23

    You can use the following:

    mvn -Dmaven.test.skip=true release:prepare release:perform
    

    Within release-plugin the arguments are passed via -Darguments='....' to the sub process which is started by release:perform. The other arguments are passed to the process which is started by release:prepare.

    0 讨论(0)
提交回复
热议问题