[
http://jira.codehaus.org/browse/MRESOURCES-43?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_116355
]
Bart Robeyns commented on MRESOURCES-43:
----------------------------------------
I've created a patch that allows you to set a 'forceWrite'-flag on the
resources-plugin's configuration; it defaults to 'false', maintaining the
current behaviour.
The patch removes the destination-file before copying the source file over.
(I encountered the issue myself when weaving dependent jars with the
aspectj-plugin; resources in the dependent jars get extracted in
target\classes, and afterwards the resources-plugin won't override them
anymore.)
However, the actual ambiguity lies in Plexus' FileUtils.copyFile, which only
compares the modified-date of source and destinations if filtering is off;
it might be more appropriate to provide a flag in this method whether the date
should be verified (both with and without filtering turned on).
Hence my question: should I upload the patch or not?
> resources:resources overwrites destination files when filtering is on, not
> when filtering is off
> ------------------------------------------------------------------------------------------------
>
> Key: MRESOURCES-43
> URL: http://jira.codehaus.org/browse/MRESOURCES-43
> Project: Maven 2.x Resources Plugin
> Issue Type: Bug
> Affects Versions: 2.2
> Environment: Linux
> Reporter: Roar Lauritzsen
>
> It is not possible to specify that resources:resources should overwrite
> destination files or not if they already exist.
> However, the behavior should at the very least be predictable so that one can
> achieve the desired result through phase ordering or ant scripts.
> As it is today, when filtering is turned on, destination files are
> overwritten. When filtering is off, destination files are not overwritten.
> If not selectable, the most practical solution would be to always overwrite
> (I believe).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira