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

后端 未结 2 933
时光取名叫无心
时光取名叫无心 2021-02-18 22:32

The POM that my project inherits contains some for the release plugin that specifies some additional arguments.

相关标签:
2条回答
  • 2021-02-18 23:11

    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>
    
    0 讨论(0)
  • 2021-02-18 23:26

    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.

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