mirror of https://github.com/apache/maven.git
[MNG-5402] Better build number for git
Signed-off-by: Anders Hammar <anders@hammar.net>
This commit is contained in:
parent
19492b485a
commit
f95ab2e7cd
|
@ -124,73 +124,33 @@
|
|||
</models>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>create-noncanonicalrev</id>
|
||||
<goals>
|
||||
<goal>create-timestamp</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<timestampFormat>'NON-CANONICAL_'yyyy-MM-dd_HH-mm_'${user.name}'</timestampFormat>
|
||||
<timestampPropertyName>nonCanonicalRevision</timestampPropertyName>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>create-buildnumber</id>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<doCheck>false</doCheck>
|
||||
<doUpdate>false</doUpdate>
|
||||
<revisionOnScmFailure>${nonCanonicalRevision}</revisionOnScmFailure>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>svn-buildnumber</id>
|
||||
<activation>
|
||||
<file>
|
||||
<exists>.svn</exists>
|
||||
</file>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<doCheck>false</doCheck>
|
||||
<doUpdate>false</doUpdate>
|
||||
<providerImplementations>
|
||||
<svn>javasvn</svn>
|
||||
</providerImplementations>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>non-canonical-buildnumber</id>
|
||||
<activation>
|
||||
<file>
|
||||
<missing>.svn</missing>
|
||||
</file>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>create</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<doCheck>false</doCheck>
|
||||
<doUpdate>false</doUpdate>
|
||||
<format>NON-CANONICAL_{0,date,yyyy-MM-dd_HH-mm}_{1}</format>
|
||||
<items>
|
||||
<item>timestamp</item>
|
||||
<item>${user.name}</item>
|
||||
</items>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
|
|
@ -83,7 +83,7 @@ public final class CLIReportingUtils
|
|||
if ( rev != null || timestamp != null )
|
||||
{
|
||||
msg += " (";
|
||||
msg += ( rev != null ? "r" + rev : "" );
|
||||
msg += ( rev != null ? rev : "" );
|
||||
if ( timestamp != null )
|
||||
{
|
||||
SimpleDateFormat fmt = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ssZ" );
|
||||
|
|
Loading…
Reference in New Issue