[
http://jira.codehaus.org/browse/MCLEAN-31?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Benjamin Bentmann updated MCLEAN-31:
------------------------------------
Attachment: relative-paths.patch
I previously attached a minimal patch to spotlight the problem. Here is the
patch that I suggest to actually apply since it provides the following overall
improvements besides the fix alone:
- The methods removeDir() and removeAdditionalFileSets() contain a shared
aspect (removeFileSet()) which should be refactored out into a dedicated method
in order to ease maintainance and consistency.
- The usage of the custom type Fileset (which inherits from FileSet just for
the sake of a nice toString()) has been reduced to minimum just like one
usually declares variables to be of type java.util.Collection instead of
java.util.ArrayList of whatever speciailized implemention has been chosen (i.e.
program against the least specific interface/class).
> Always resolve relative path against the project's base directory
> -----------------------------------------------------------------
>
> Key: MCLEAN-31
> URL: http://jira.codehaus.org/browse/MCLEAN-31
> Project: Maven 2.x Clean Plugin
> Issue Type: Bug
> Reporter: Benjamin Bentmann
> Fix For: 2.2
>
> Attachments: clean.zip, relative-paths.patch, relative-paths.patch
>
>
> Relative paths - which are often used by users for plugin configuration in
> the POM - must always be resolved against the base directory of the current
> project. By always I mean not just when run in a reactor build.
> Attached is a patch to fix the mojo as well as a mini project to reveal the
> bug. Just unpack the project, change your working directory to the parent
> folder of its base directory or any other directory that does not contain the
> POM and run Maven on the test POM from this working directory using its -f
> switch. The plugin will not delete the "test-target" directory in the project
> base directory but instead delete an equally named directory in the current
> working directory.
--
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