[
https://issues.apache.org/jira/browse/MCLEAN-36?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17958677#comment-17958677
]
Olivier Lamy commented on MCLEAN-36:
------------------------------------
This project has moved from Jira to GitHub Issues. This issue was migrated to
[apache/maven-clean-plugin#200|https://github.com/apache/maven-clean-plugin/issues/200].
> filesets with an absolute path directory are ignored when
> !project.isExecutionRoot()
> ------------------------------------------------------------------------------------
>
> Key: MCLEAN-36
> URL: https://issues.apache.org/jira/browse/MCLEAN-36
> Project: Maven Clean Plugin (Moved to GitHub Issues)
> Issue Type: Bug
> Affects Versions: 2.2
> Reporter: Will Horn
> Assignee: Benjamin Bentmann
> Priority: Major
> Fix For: 2.3
>
> 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 was sent by Atlassian Jira
(v8.20.10#820010)