Bug 8069 - If the "update" option is set on the JAR task, the target jar will be updated even if an update is not required
Summary: If the "update" option is set on the JAR task, the target jar will be update...
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.4.1
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
: 9163 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-14 16:46 UTC by jrobke
Modified: 2008-02-22 12:18 UTC (History)
3 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jrobke 2002-04-14 16:46:29 UTC
If the "update" option is set on the JAR task,  the target jar will be updated 
even if an update is not required (ie the src files passed to the jar task are 
at the same level as the files in the target jar).  

I have done an initial investigation of this problem below are my findings:

-When the update option is set the Zip task renames the zipFile to a tmp file 
before the call to isUpToDate(...) is made.  The isUpToDate method is passed 
the original zipFile name.  The original file no longer exists because the file 
was renamed.  Therefore when Jar.isUpToDate trys to find the ZipFile it no 
longer exists and the following exception is thrown: 
java.util.zip.ZipExceptionThe system cannot find the file specified.  The 
exception flags the Jar task to update the jar.

-This bug can be fixed by moving the isUpToDate call above the zipFile rename 
in the ZIP task.
Comment 1 Stefan Bodewig 2002-05-16 15:51:07 UTC
*** Bug 9163 has been marked as a duplicate of this bug. ***
Comment 2 Stefan Bodewig 2002-06-11 13:49:58 UTC
*** Bug 9713 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Bodewig 2002-06-27 09:29:32 UTC
Fixed in the 1.5 branch as can be verified with the build from
<http://cvs.apache.org/~bodewig/gump/ant1.5beta/20020627/> or any later version
of Ant 1.5.