0

I'm using mercruial and buildnumber-maven-plugin 1.4. And this plugin is able to return SCM branch information with ${scmBranch} command according documentaion. However command ${scmBranch} return value UNKNOW. What i need to do to get branch name information from buildnumber-maven-plugin?

My pom.xml:

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <version>2.6</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-Build>${buildNumber}</Implementation-Build>
                <SCM-Build>${scmBranch}</SCM-Build>
              </manifestEntries>
            </archive>
          </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.4</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>create</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <scmBranchPropertyName>true</scmBranchPropertyName>


        </configuration>
      </plugin>

2 Answers2

0

Seems to be that you cannot setup buildnumber-maven-plugin with mecrurial so that ${scmBranch} will be returning branch name, Here is SO issue where is said that version 1.2 of this plugin works only with SVN branch information. I don't think it is changed in version 1.4. Moreover here is fresh report on this problem.

Community
  • 1
  • 1
SergeyLebedev
  • 3,673
  • 15
  • 29
0

Try this

Create a separate <plugins> tag </plugins> outside of <pluginManagement> and put the buildnumber maven plugin separately in there. That's what did it for me, don't ask why.

SHPstr
  • 91
  • 9