You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Franziska Ryll <RY...@ivu.de> on 2009/01/13 16:47:36 UTC
revisionNumber and timestamp in manifest-file with buildnumber-maven-plugin
Hello,
I want to include the revisionNumber and the timestamp in a human-readable
form in the manifest-file. http://jira.codehaus.org/browse/MOJO-988 states
that this is possible with the buildnumber-maven-plugin using timestampFormat
instead of format. Does anyone know how to use it? The following doesn't
work:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>
buildnumber-maven-plugin
</artifactId>
<configuration>
<timestampFormat>
{0,date,yyyy-MM-dd}
</timestampFormat>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultSpecificationEntries>
true
</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>
true
</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<SCM-Revision>${buildNumber}</SCM-Revision>
<Build-Date>${timestamp}</Build-Date>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
I get these entries in the manifest-file:
Build-Date: 1231859661271
SCM-Revision: 231958
Regards,
Franziska
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
AW: revisionNumber and timestamp in manifest-file with buildnumber-maven-plugin
Posted by "Lewis, Eric" <Er...@ipi.ch>.
Hi
I used the following successfully:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<format>{0,date,yyyyMMdd-HHmmss}</format>
<items>
<item>timestamp</item>
</items>
<buildNumberPropertyName>current.timestamp</buildNumberPropertyName>
</configuration>
</plugin>
which creates the property ${current.timestamp} (I seem to remember that ${timestamp} didn't work for me)
Best regards,
Eric
> -----Ursprüngliche Nachricht-----
> Von: Franziska Ryll [mailto:RYF@ivu.de]
> Gesendet: Dienstag, 13. Januar 2009 16:48
> An: Maven Users List
> Betreff: revisionNumber and timestamp in manifest-file with
> buildnumber-maven-plugin
>
> Hello,
>
> I want to include the revisionNumber and the timestamp in a
> human-readable
> form in the manifest-file.
> http://jira.codehaus.org/browse/MOJO-988 states
> that this is possible with the buildnumber-maven-plugin using
> timestampFormat
> instead of format. Does anyone know how to use it? The
> following doesn't
> work:
>
> <plugins>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>
> buildnumber-maven-plugin
> </artifactId>
> <configuration>
> <timestampFormat>
> {0,date,yyyy-MM-dd}
> </timestampFormat>
> </configuration>
> <executions>
> <execution>
> <phase>validate</phase>
> <goals>
>
> <goal>create</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> <plugin>
>
> <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-jar-plugin</artifactId>
> <configuration>
> <archive>
> <manifest>
>
> <addClasspath>true</addClasspath>
>
> <addDefaultSpecificationEntries>
> true
>
> </addDefaultSpecificationEntries>
>
> <addDefaultImplementationEntries>
> true
>
> </addDefaultImplementationEntries>
> </manifest>
> <manifestEntries>
>
> <SCM-Revision>${buildNumber}</SCM-Revision>
>
> <Build-Date>${timestamp}</Build-Date>
> </manifestEntries>
> </archive>
> </configuration>
> </plugin>
> </plugins>
>
> I get these entries in the manifest-file:
> Build-Date: 1231859661271
> SCM-Revision: 231958
>
> Regards,
> Franziska
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org