You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hence, the Javadoc says one, but this method does "extract only if not exists or is newer" (and there is case thing but keep this issue simple). Basically, if file exists, and is newer, it is NOT overwritten despite overwrite member is true.
Reason: using git results that files being used (for example checked out) will always have "now" timestamps, even if project itself is ancient (years old). Hence, this MAY be causing issue like https://issues.apache.org/jira/browse/MWRAPPER-77
The text was updated successfully, but these errors were encountered:
Regression in efd980d changed the way
UnArchiver#isOverwrite flag work.
It is indented to indicate that UnArchiver should
always override the existing entries.
efd980d changed it to indicate whether existing file
should be overridden if the entry is newer,
while in this case the file should be always overridden.
This commit returns the old behavior: if the entry
is newer, override the existing file; if the entry
is older, override the existing file only if isOverwrite is true.
Fixes: #228
Regression in efd980d changed the way
UnArchiver#isOverwrite flag work.
It is indented to indicate that UnArchiver should
always override the existing entries.
efd980d changed it to indicate whether existing file
should be overridden if the entry is newer,
while in this case the file should be always overridden.
This commit returns the old behavior: if the entry
is newer, override the existing file; if the entry
is older, override the existing file only if isOverwrite is true.
Fixes: #228
In case of UnArchiver we have this Javadoc:
https://github.com/codehaus-plexus/plexus-archiver/blob/master/src/main/java/org/codehaus/plexus/archiver/UnArchiver.java#L58-L66
The default value of
overwrite
member istrue
:https://github.com/codehaus-plexus/plexus-archiver/blob/master/src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java#L64
But in AbstractUnArchiver, the extractFile method invokes shouldExtractEntry method to check is entry to be extracted, and this method looks like this:
https://github.com/codehaus-plexus/plexus-archiver/blob/master/src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java#L401-L453
Hence, the Javadoc says one, but this method does "extract only if not exists or is newer" (and there is case thing but keep this issue simple). Basically, if file exists, and is newer, it is NOT overwritten despite overwrite member is true.
This is kinda confirmed with UTs as well:
https://github.com/codehaus-plexus/plexus-archiver/blob/master/src/test/java/org/codehaus/plexus/archiver/AbstractUnArchiverTest.java#L127-L180
Do I miss something here?
Reason: using git results that files being used (for example checked out) will always have "now" timestamps, even if project itself is ancient (years old). Hence, this MAY be causing issue like https://issues.apache.org/jira/browse/MWRAPPER-77
The text was updated successfully, but these errors were encountered: