maven buildnumber plugin not working with mercurial

1.6k views Asked by At

I'm trying to get the mercurial revision number in the manifest. I've read following instructions:

http://maven.apache.org/plugin-developers/cookbook/add-svn-revision-to-manifest.html

Maven + Mercurial for Build Numbers

I do not get an error message but the SCM-Revision property in the manifest is always empty.

Section from POM:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>buildnumber-maven-plugin</artifactId>
    <executions>
        <execution>
            <phase>validate</phase>
            <goals>
                <goal>hgchangeset</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <doCheck>false</doCheck>
        <doUpdate>true</doUpdate>
    </configuration>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <configuration>
        <archive>
            <manifestEntries>                            
                <SCM-Revision>${buildNumber}</SCM-Revision>
            </manifestEntries>
        </archive>
    </configuration>
</plugin>

how can I resolve this problem?

1

There are 1 answers

0
beginner_ On BEST ANSWER

${buildNumber} is for svn. If you use mercurial you need to use ${changeSet} to get the mercurial revision number.