You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Douglas Ferguson (JIRA)" <ji...@codehaus.org> on 2006/08/31 22:03:48 UTC
[jira] Commented: (MWAR-47) Regression : Files not copied when
overlaying wars
[ http://jira.codehaus.org/browse/MWAR-47?page=comments#action_73836 ]
Douglas Ferguson commented on MWAR-47:
--------------------------------------
I actually would prefer that files in the "real,final" projects would take priority over anything in a dependency.
I was suprised when this changed. Could this be configurable?
D-
> Regression : Files not copied when overlaying wars
> --------------------------------------------------
>
> Key: MWAR-47
> URL: http://jira.codehaus.org/browse/MWAR-47
> Project: Maven 2.x War Plugin
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Eric Bottard
> Assigned To: Brett Porter
> Fix For: 2.0.1
>
> Original Estimate: 30 minutes
> Time Spent: 45 minutes
> Remaining Estimate: 0 minutes
>
> The handy "overlay wars" functionnality seems to have changed with release 2.0 : files that are already in place (no matter last modification date) are never overwritten from overlaid wars.
> This is problematic since after a first packaging of the war file, any file coming from a dependent war will already sit there and will never be updated.
> The faulty line is here (AbstractWarMojo.java):
> for ( int j = 0; j < files.length; j++ )
> {
> File targetFile = new File( targetDir, files[j] );
> // Do not overwrite existing files.
> if ( !targetFile.exists() ) // <========================== WILL ALWAYS FAIL
> {
> try
> {
> targetFile.getParentFile().mkdirs();
> copyFileIfModified( new File( srcDir, files[j] ), targetFile );
> }
> catch ( IOException e )
> {
> throw new MojoExecutionException( "Error copying file '" + files[j] + "' to '" + targetFile + "'",
> e );
> }
> }
> }
> My use case is, I guess, pretty common : I have a "framework" project (packaging = war) that must benefit may "real, final" projects that produce the final artifact (packaging = war as well). The "framework" part is a 'dependent war' of the real project and is 'overlaid' by the war plugin. The trouble is, if I update any file of the framework part, changes are not taken into account since files already exist in the target directory.
> Please consider removing the " if ( !targetFile.exists() )" part (last modification date alone is fine).
> regards,
> eb.
--
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