Bug 29085 - Timestamps in jar-Manifest
Summary: Timestamps in jar-Manifest
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.6.1
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
: 31410 (view as bug list)
Depends on:
Reported: 2004-05-19 12:22 UTC by daniel.estermann
Modified: 2009-07-31 05:42 UTC (History)
2 users (show)


Note You need to log in before you can comment on or make changes to this bug.
Description daniel.estermann 2004-05-19 12:22:46 UTC
Currently, a jar-file is updated if one of the manifest entries changes.
If an entry contains the build-time, I don't want the jar to be rewritten every
time i build the project. The build-time entry should just be updated if
anything else in the jar changed.

I propose to introduce a new flag (named 'forceupdate' or similar) for a
manifest attribute. That flag tells wether the entry must be compared with the
old state or if a possible change should be ignored. 


A logical and simple solution is to change the Manifest.equals method to ignore
the selected entries. However, i do not know if this affects other tasks.
Comment 1 Jesse Glick 2004-06-05 19:50:16 UTC
This would be useful. netbeans.org has a generic script that uses something like

  <format property="buildnumber" .../>
<jar jarfile="..." manifest="${some-basic-manifest}">
  <!-- various important fixed attributes... then: -->
    <attribute name="Impl-Version" value="${buildnumber}"/>
  <fileset .../>

Currently the JAR is always rebuilt, which is annoying and slows down the build.
Possible workaround would be to create a temporary manifest somewhere using
<manifest> with everything but the Impl-Version set to "@BUILD-NUMBER@", then
<copy> with a filter, then make the JAR; cumbersome.

I could probably supply a patch for this if committers would be interested in
applying it.
Comment 2 Stefan Bodewig 2009-07-31 05:42:30 UTC
*** Bug 31410 has been marked as a duplicate of this bug. ***