filesets with an absolute path directory are ignored when
!project.isExecutionRoot()
------------------------------------------------------------------------------------
Key: MCLEAN-36
URL: http://jira.codehaus.org/browse/MCLEAN-36
Project: Maven 2.x Clean Plugin
Issue Type: Bug
Affects Versions: 2.2
Reporter: Will Horn
Attachments: mvn-test.zip
Due to the fix for http://jira.codehaus.org/browse/MCLEAN-27, mvn clean will
not delete a fileset with a directory represented by an absolute path when run
from a parent directory. Instead it will automatically prepend the project
directory path to the absolute path and silently do nothing after not find the
directory. The logic responsible is in
http://svn.apache.org/viewvc/maven/plugins/tags/maven-clean-plugin-2.2/src/main/java/org/apache/maven/plugin/clean/CleanMojo.java?revision=594869&view=markup
getLog().info( "Deleting " + fileset );
if ( !project.isExecutionRoot() )
{
String projectBasedir = StringUtils.replace(
project.getBasedir().getAbsolutePath(), "\\", "/" );
String filesetDir = StringUtils.replace(
fileset.getDirectory(), "\\", "/" );
if ( filesetDir.indexOf( projectBasedir ) == -1 )
{
fileset.setDirectory( projectBasedir + "/" +
filesetDir );
}
}
fileSetManager.delete( fileset );
The issue can be seen in the attached test project. If a directory c:\mvntemp
exists, then "mvn clean" from the base directory will not delete it. "mvn
clean" from inside subproject will work since project.isExecutionRoot() is true
and the above logic is not executed.
--
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