Overlaying checks timestamps
----------------------------

                 Key: MWAR-65
                 URL: http://jira.codehaus.org/browse/MWAR-65
             Project: Maven 2.x War Plugin
          Issue Type: Bug
    Affects Versions: 2.0.1
            Reporter: Brian Fox
            Priority: Critical


So I'm looking into the latest war plugin because upgrading from a very old 
version (beta2) broke my build. We are currently doing this:
 
I create wars that are intended to be repackaged by excluding all jars and some 
various other files I don't want included (we create 2 wars, one that can be 
run standalone for unit testing and one that is deployed). In the war that does 
the repackaging, I use the dependency plugin to unpack the first war into the 
target folder where the war plugin does the inplace processing. This broke 
because between beta2 and 2.0.1, code was added to check the file timestamp. If 
the timestamp in the project is older than the one being unpacked, then it 
isn't used, even though we intend it to.

The overlaying performed by the war plugin when there are dependent wars 
suffers from the same problem. The comment in the source says that no files 
will be overwritten. In my case, this would work because I could layer them 
correctly. The problem is that the code calls the same copyifmodified method 
which checks the timestamps.

This is what the source code says it will do:

    /**
     * Recursively copies contents of <tt>srcDir</tt> into <tt>targetDir</tt>.
     * This will not overwrite any existing files.
     *
     * @param srcDir    Directory containing unpacked dependent war contents
     * @param targetDir Directory to overlay srcDir into
    private void copyDependentWarContents( File srcDir, File targetDir )
        throws MojoExecutionException

But this is what it does:
copyFileIfModified( new File( srcDir, files[j] ), targetFile );

So the question: is this a bug, in otherwords should it always not overwrite or 
should I add a flag to tell it to not overwrite? If a flag, which should be the 
default?


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

        

Reply via email to