Execute Maven plugin goal on parent module, but not on children

前端 未结 5 1519
生来不讨喜
生来不讨喜 2020-12-08 01:47

We have a multi-module maven project that uses a profile that defines a buildnumber-maven-plugin to increment a build number and then check it into source control.

I

5条回答
  •  再見小時候
    2020-12-08 02:19

    As documented in the Plugins section of the pom reference:

    Beyond the standard coordinate of groupId:artifactId:version, there are elements which configure the plugin or this builds interaction with it.

    • inherited: true or false, whether or not this plugin configuration should apply to POMs which inherit from this one.

    So just add false to the buildnumber-maven-plugin configuration to avoid inheritance in children POMs:

          
            org.codehaus.mojo
            buildnumber-maven-plugin
            1.0-beta-3
            false
            ...
          
    

提交回复
热议问题