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>
|
</models>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</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>
|
</plugins>
|
||||||
</build>
|
</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>
|
</project>
|
||||||
|
|
|
@ -83,7 +83,7 @@ public final class CLIReportingUtils
|
||||||
if ( rev != null || timestamp != null )
|
if ( rev != null || timestamp != null )
|
||||||
{
|
{
|
||||||
msg += " (";
|
msg += " (";
|
||||||
msg += ( rev != null ? "r" + rev : "" );
|
msg += ( rev != null ? rev : "" );
|
||||||
if ( timestamp != null )
|
if ( timestamp != null )
|
||||||
{
|
{
|
||||||
SimpleDateFormat fmt = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ssZ" );
|
SimpleDateFormat fmt = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ssZ" );
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -398,7 +398,7 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.2</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|
Loading…
Reference in New Issue