Add build time and branch to MANIFEST.

This commit is contained in:
Manuele Simi 2019-10-15 23:36:28 -04:00
parent d184036935
commit fc5bcba800
1 changed files with 54 additions and 45 deletions

99
pom.xml
View File

@ -458,12 +458,28 @@
<goals>
<goal>create</goal>
</goals>
<configuration>
<useLastCommittedRevision>true</useLastCommittedRevision>
<scmBranchPropertyName>scmBranch</scmBranchPropertyName>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</execution>
<execution>
<id>create-timestamp-id</id>
<phase>validate</phase>
<goals>
<goal>create-timestamp</goal>
</goals>
<configuration>
<timestampFormat>yyyy-MM-dd HH:mm:ss.S</timestampFormat>
<timestampPropertyName>scmDate</timestampPropertyName>
<!-- formats the timestamp all together like 2016-04-04 14:17:05.123 and puts
it in the ${myBuildNumberVariable} buildProperty -->
</configuration>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -477,10 +493,43 @@
</manifest>
<manifestEntries>
<SCM-Revision>${buildNumber}</SCM-Revision>
<Build-Time>${scmDate}</Build-Time>
<SCM-Branch>${scmBranch}</SCM-Branch>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>enforce</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[${maven.version},)</version>
<message>Check for Maven version &gt;=${maven.version} failed. Update your Maven install.</message>
</requireMavenVersion>
<!--requireJavaVersion>
<version>${java_version}</version>
</requireJavaVersion-->
<requireProperty>
<property>java.vm.name</property>
<message>Java Vendor must be OpenJDK.</message>
<regex>${java.expected.vm}</regex>
<regexMessage>Java Vendor must be OpenJDK. Found: ${java.vm.name}</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
@ -679,53 +728,13 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.4</version>
<executions>
<execution>
<id>useLastCommittedRevision</id>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
</plugin>
<!-- enforce integration build requirements -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0.1</version>
<executions>
<execution>
<id>enforce</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>[${maven.version},)</version>
<message>Check for Maven version &gt;=${maven.version} failed. Update your Maven install.</message>
</requireMavenVersion>
<!--requireJavaVersion>
<version>${java_version}</version>
</requireJavaVersion-->
<requireProperty>
<property>java.vm.name</property>
<message>Java Vendor must be OpenJDK.</message>
<regex>${java.expected.vm}</regex>
<regexMessage>Java Vendor must be OpenJDK. Found: ${java.vm.name}</regexMessage>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>