You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Eric Bottard (JIRA)" <ji...@codehaus.org> on 2006/06/12 14:01:42 UTC

[jira] Commented: (MWAR-47) Regression : Files not copied when overlaying wars

    [ http://jira.codehaus.org/browse/MWAR-47?page=comments#action_67168 ] 

Eric Bottard commented on MWAR-47:
----------------------------------

Please read " ... must benefit MANY "real, final" projects ..." above

> Regression : Files not copied when overlaying wars
> --------------------------------------------------
>
>          Key: MWAR-47
>          URL: http://jira.codehaus.org/browse/MWAR-47
>      Project: Maven 2.x War Plugin
>         Type: Bug

>     Versions: 2.0
>     Reporter: Eric Bottard

>
>
> 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