开发者

Buildnumber not getting propagated down to childern from parent

开发者 https://www.devze.com 2023-03-13 08:01 出处:网络
I am using the buildnumber-maven-plugin in my parent pom to create a build number.This works fine.However, I need to have the ${buildNumber} property in my child.I have added antrun ECHO for that prop

I am using the buildnumber-maven-plugin in my parent pom to create a build number. This works fine. However, I need to have the ${buildNumber} property in my child. I have added antrun ECHO for that property in my child and it is not there. How can I propagated that property down to children?

<plugin>
    <groupId>org.codehaus.mojo<开发者_运维问答;/groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <inherited>false</inherited>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>create</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <buildNumberPropertiesFileLocation>buildnumber.properties</buildNumberPropertiesFileLocation>
        <format>{0,number,integer}</format>
        <items>
            <item>buildNumber0</item>
        </items>
    </configuration>
</plugin>


I found the issue. This may be a bug in the build number plug in. The property I use for the build number (the default name or one I set) does not get propagated down to the child project unless I add in

<getRevisionOnlyOnce>true</getRevisionOnlyOnce>

After adding this line in my pom for the build number plugin, all worked fine. Seems like if you don't have this line in the pom for that plugin it whips out the build number property upon completion of the Parent. Not sure. But all is working now.


Try to remove

<inherited>false</inherited>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号