Maven 2.x Clean Plugin

followSymLinks is always set to true

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 2.3
  • Fix Version/s: 2.4
  • Component/s: None
  • Labels:
    None
  • Environment:
    Maven 2.0.9, Linux
  • Testcase included:
    yes
  • Number of attachments :
    2

Description

From my tests, followSymLinks that is used to delete the content of symlink when it is set to true, is not taken in account.
It should be a regression caused by http://jira.codehaus.org/browse/MCLEAN-28

This is a blocker bug, since it could delete all the filesystem easily, and there is no workaround. Even when I set followSymLinks explicitley to false, Maven clean 2.3 follow symlinks and delete its contents.

To reproduce :
Declare 2.3 clean plugin in your pom
mkdir /tmp/test
touch /tmp/test/foo
symlink -s /tmp/test /myproject/target/test
cd /myproject
mvn clean

After runnig that, /tmp/test is empty !

If it is confirmed, I would recommand to release quickly a 2.4 version with a fix, since in is REALLY dansgerous.

Issue Links

Activity

Hide
Bouiaw added a comment -

The only workaround I have found is to use 2.1.1 release.

Show
Bouiaw added a comment - The only workaround I have found is to use 2.1.1 release.
Hide
Brian Fox added a comment -

A quick scan of the code shows everything in order. Can you include output of "mvn clean -X" ?

Show
Brian Fox added a comment - A quick scan of the code shows everything in order. Can you include output of "mvn clean -X" ?
Hide
Bouiaw added a comment -

You will find attached the output of mvn -X clean, and a test case to reproduce the issue.
Run the sh script and next run mvn clean to see the issue : /tmp/test/toto is deleted with default configuration !

Show
Bouiaw added a comment - You will find attached the output of mvn -X clean, and a test case to reproduce the issue. Run the sh script and next run mvn clean to see the issue : /tmp/test/toto is deleted with default configuration !
Hide
Bouiaw added a comment -

From what I saw, there is a few code in the clean plugin, and from a diff between 2.1.1 (where the issue did not occure) and 2.3, I don't see any change that could cause this bug.

I think the issue come from something that has been broken between Maven file-management 1.0 (Maven clean 2.1.1) and Maven file-management 1.2.1 (Maven clean 2.3), eventually from its plexus-utils dependency.

For information, this bug is not testable with Maven Clean 2.2 (file-management 1.2) because of http://jira.codehaus.org/browse/MCLEAN-28.

Show
Bouiaw added a comment - From what I saw, there is a few code in the clean plugin, and from a diff between 2.1.1 (where the issue did not occure) and 2.3, I don't see any change that could cause this bug. I think the issue come from something that has been broken between Maven file-management 1.0 (Maven clean 2.1.1) and Maven file-management 1.2.1 (Maven clean 2.3), eventually from its plexus-utils dependency. For information, this bug is not testable with Maven Clean 2.2 (file-management 1.2) because of http://jira.codehaus.org/browse/MCLEAN-28.
Hide
Benjamin Bentmann added a comment -

Fixed in r897682.

Show
Benjamin Bentmann added a comment - Fixed in r897682.

People

Vote (4)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: