gitmavenintellij-ideaidebuildnumber-maven-plugin

Build-number doesn't work when running from IDE


I'm trying to setup automatic append of git commit hash to maven artifacts. I managed to get it working flawlessly when building with maven from console but when I run it from IntelliJ IDEA I get artifacts with names like mainlogic-${buildNumber}

Is it a matter of IDE configuration or a plugin bug?

Bumping version up to 1.2 doesn't help.

My pom.xml:

<finalName>${project.artifactId}-${buildNumber}</finalName>

      <plugin> 
          <groupId>org.codehaus.mojo</groupId>

            <artifactId>buildnumber-maven-plugin</artifactId>
            <version>1.1</version>
            <executions>
                <execution>
                    <phase>validate</phase>
                    <goals>
                        <goal>create</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <shortRevisionLength>8</shortRevisionLength>
            </configuration>
        </plugin>

Solution

  • It is/was a short coming of the maven plug-in. It has been fixed in IDEA 13, currently available in EAP.