Override Maven plugin configuration defined in the pom pluginManagement from the command line

血红的双手。 提交于 2019-12-03 22:57:06

Found the solution. In my POM I add this which overrides the settings in the parent POM and allows to specify additional arguments on command line, e.g. -Darguments=-Pmock

<pluginManagement>
    <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
            <arguments>${arguments} -Prelease</arguments>
        </configuration>
    </plugin>
</pluginManagement>

You cannot override a configuration, which is already set in the POM (see Maven Bug MNG-4979). You may use variables in order to avoid this behaviour. The snippet of your answer makes use of it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!