Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
-
None
Description
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
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.
Attachments
Issue Links
- relates to
-
MWAR-72 Need ability to protect (or exclude) resource from being destroyed during war overlay.
- Closed