maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Bentmann (JIRA)" <j...@codehaus.org>
Subject [jira] Closed: (MCLEAN-36) filesets with an absolute path directory are ignored when !project.isExecutionRoot()
Date Wed, 03 Sep 2008 22:07:48 GMT

     [ http://jira.codehaus.org/browse/MCLEAN-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benjamin Bentmann closed MCLEAN-36.
-----------------------------------

         Assignee: Benjamin Bentmann
       Resolution: Fixed
    Fix Version/s: 2.3

Fixed in [r691788|http://svn.apache.org/viewvc?view=rev&revision=691788], added corresponding
test in [r691803|http://svn.apache.org/viewvc?view=rev&revision=691803].

> 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
>            Assignee: Benjamin Bentmann
>             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 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

        

Mime
View raw message