You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Mike Perham <Mi...@webifysolutions.com> on 2006/03/29 01:03:34 UTC

adding build timestamp to manifest

http://jira.codehaus.org/browse/MNG-1832

It seems like one way to support this would be:

<configuration>
     <archive>
	   <manifestEntries>
              <Build-Time>${now}</Build-Time>
         </manifestEntries>
     </archive>
</configuration>

But we would need to add support for this variable in the POM
interpolation code and it's not clear how to format the Date.  Any other
suggestions?

mike

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: adding build timestamp to manifest

Posted by Joakim Erdfelt <jo...@erdfelt.net>.
I think this is a good idea, but instead of worrying about the format to output,
how about using the ISO8601 formatting guidelines?

Simple pattern would be: "yyyy-MM-dd'T'HH:mm:ss"

But that pattern does not take in account the Timezone.
We can use the recommendations in ISO8601 and either...
(a) Adjust the time to UTC before output.
    Using the pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'"
(b) Leave the timezone intact and output the UTC offset.
    Using the pattern: "yyyy-MM-dd'T'HH:mm:ssZ"

That way we also have a human and machine readable (and predictable) timestamp.

- Joakim


Kenney Westerhof wrote:
> On Tue, 28 Mar 2006, Mike Perham wrote:
>
> Hi,
>
> some thoughts on this:
>
>   
>> http://jira.codehaus.org/browse/MNG-1832
>>
>> It seems like one way to support this would be:
>>
>> <configuration>
>>      <archive>
>> 	   <manifestEntries>
>>               <Build-Time>${now}</Build-Time>
>>          </manifestEntries>
>>      </archive>
>> </configuration>
>>
>> But we would need to add support for this variable in the POM
>> interpolation code and it's not clear how to format the Date.  Any other
>> suggestions?
>>     
>
> The archiver itself can add this field in the manifest, no need for
> expressions then.
>
> Perhaps re-use the timestamp used on snapshot naming?
>
> The ${now} is rather unprecise; builds can take minutes, what time is
> used? Perhaps the 'ctime' of the main artifact?
>
> Btw, it looks like this is some abuse of a versioning scheme. If
> non-snapshot versions are used, the version is clear. If snapshots are
> used, also clear versions (1.0-YYYYMMDDHHMMSS) are used. I think those
> are accessible from pom.properties?
>
> The 'Implementation-Version' manifest entry currently reports the
> -SNAPSHOT version; a filled-out SNAPSHOT version could be added
> to that too, but I think it's calculated on the moment of deployment.
> We would need to define a clear moment when that is calculated, so
> on deployment, the filename contains the same version tag as the
> manifest entry.
>
>  -- Kenney
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: adding build timestamp to manifest

Posted by Kenney Westerhof <ke...@apache.org>.
On Tue, 28 Mar 2006, Mike Perham wrote:

Hi,

some thoughts on this:

> http://jira.codehaus.org/browse/MNG-1832
>
> It seems like one way to support this would be:
>
> <configuration>
>      <archive>
> 	   <manifestEntries>
>               <Build-Time>${now}</Build-Time>
>          </manifestEntries>
>      </archive>
> </configuration>
>
> But we would need to add support for this variable in the POM
> interpolation code and it's not clear how to format the Date.  Any other
> suggestions?

The archiver itself can add this field in the manifest, no need for
expressions then.

Perhaps re-use the timestamp used on snapshot naming?

The ${now} is rather unprecise; builds can take minutes, what time is
used? Perhaps the 'ctime' of the main artifact?

Btw, it looks like this is some abuse of a versioning scheme. If
non-snapshot versions are used, the version is clear. If snapshots are
used, also clear versions (1.0-YYYYMMDDHHMMSS) are used. I think those
are accessible from pom.properties?

The 'Implementation-Version' manifest entry currently reports the
-SNAPSHOT version; a filled-out SNAPSHOT version could be added
to that too, but I think it's calculated on the moment of deployment.
We would need to define a clear moment when that is calculated, so
on deployment, the filename contains the same version tag as the
manifest entry.

 -- Kenney

>
> mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org