You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Bryce Fischer <br...@berzerker-soft.com> on 2007/01/29 17:39:01 UTC
Current Date
Is there a way to use the current date in the POM? For example, I want
to put the current date in the manifest, so I would like to do
something like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<mode>development</mode>
<Implementation-Version>${pom.version}</Implementation-Version>
<Build-Date>${today}</Build-Date>
</manifestEntries>
</archive>
</configuration>
</plugin>
Thanks.
Bryce
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Current Date
Posted by Bryce Fischer <br...@berzerker-soft.com>.
Hi Greg. This looks to be exactly what I need. I will take a look at it.
On 1/29/07, Greg Jones <gr...@gkj.com.au> wrote:
> Bryce,
>
> Take a look at the buildnumber plugin. I use it to generate a build date
> each time I do a build, as follows:
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: Current Date
Posted by Greg Jones <gr...@gkj.com.au>.
Bryce,
Take a look at the buildnumber plugin. I use it to generate a build date
each time I do a build, as follows:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>maven-buildnumber-plugin</artifactId>
<version>0.9.4</version>
<configuration>
<format>{0,date,yyyy-MM-dd HH:mm:ss}</format>
<items>
<item>timestamp</item>
</items>
<doCheck>false</doCheck>
<doUpdate>false</doUpdate>
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
</plugin>
The build date is available as ${buildNumber} in my POMs and resource files.
A useful extension to this plugin would be the ability to specify the name
of the property to set so that you could use both a build number and a build
date.
Hope this helps.
Regards,
Greg J.
-----Original Message-----
From: Bryce Fischer [mailto:bryce@berzerker-soft.com]
Sent: Tuesday, 30 January 2007 3:39 AM
To: users@maven.apache.org
Subject: Current Date
Is there a way to use the current date in the POM? For example, I want to
put the current date in the manifest, so I would like to do something like
this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<mode>development</mode>
<Implementation-Version>${pom.version}</Implementation-Version>
<Build-Date>${today}</Build-Date>
</manifestEntries>
</archive>
</configuration>
</plugin>
Thanks.
Bryce
---------------------------------------------------------------------
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