[ http://jira.codehaus.org/browse/MCLEAN-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MCLEAN-28. ----------------------------------- Assignee: Benjamin Bentmann Resolution: Fixed Fix Version/s: 2.3 Fixed in [r692711|http://svn.apache.org/viewvc?view=rev&revision=692711] by updating to plexus-utils:1.5.6, added test in [r692725|http://svn.apache.org/viewvc?view=rev&revision=692725]. > maven-clean-plugin doesn't delete directories with symlinks in them > ------------------------------------------------------------------- > > Key: MCLEAN-28 > URL: http://jira.codehaus.org/browse/MCLEAN-28 > Project: Maven 2.x Clean Plugin > Issue Type: Bug > Affects Versions: 2.2 > Environment: maven 2.0.7, Ubuntu 7.10, Intel Pentium M > Reporter: Steinar Bang > Assignee: Benjamin Bentmann > Fix For: 2.3 > > > Note: this issue did not happen with maven-2.0.4 and maven-clean-plugin 2.1.1. > I have a maven project for a JNI library wrapping several shared libs. For > testing, the shared libs are unpacked into target/tmplib, and the > maven-surefire-plugin gets a LD_LIBRARY_PATH enviroment variable setting > pointing to this directory. > The shared libs are unpacked in a manner that preserves their symbolic links, > eg. > lrwxrwxrwx 1 sb sb 17 Dec 23 22:00 libxml2.so -> libxml2.so.2.6.23 > lrwxrwxrwx 1 sb sb 17 Dec 23 22:00 libxml2.so.2 -> libxml2.so.2.6.23 > -rwxr-x--- 1 sb sb 3104024 Nov 28 13:23 libxml2.so.2.6.23 > lrwxrwxrwx 1 sb sb 13 Dec 23 22:00 libz.so -> libz.so.1.2.3 > lrwxrwxrwx 1 sb sb 13 Dec 23 22:00 libz.so.1 -> libz.so.1.2.3 > -rwxr-x--- 1 sb sb 168053 Nov 28 13:08 libz.so.1.2.3 > When doing "mvn clean" it refuses to delete target/tmplib (see the error > message with stack trace below), and when I inspect the target/tmplib > directory, it contains only symlinks. The files they point to have been > removed. Using the example above, it now looks like: > lrwxrwxrwx 1 sb sb 17 Dec 23 22:00 libxml2.so -> libxml2.so.2.6.23 > lrwxrwxrwx 1 sb sb 17 Dec 23 22:00 libxml2.so.2 -> libxml2.so.2.6.23 > lrwxrwxrwx 1 sb sb 13 Dec 23 22:00 libz.so -> libz.so.1.2.3 > lrwxrwxrwx 1 sb sb 13 Dec 23 22:00 libz.so.1 -> libz.so.1.2.3 > The error message with stack trace, looks like this: > [INFO] [clean:clean] > [INFO] Deleting directory > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Failed to delete directory: > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target. > Reason: Unable to delete directory > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target/tmplib > [INFO] > ------------------------------------------------------------------------ > [INFO] Trace > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to delete > directory: > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target. > Reason: Unable to delete directory > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target/tmplib > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:280) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) > at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) > at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) > at org.codehaus.classworlds.Launcher.main(Launcher.java:375) > Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to delete > directory: > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target. > Reason: Unable to delete directory > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target/tmplib > at > org.apache.maven.plugin.clean.CleanMojo.removeDirectory(CleanMojo.java:265) > at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:173) > at > org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443) > at > org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539) > ... 16 more > Caused by: java.io.IOException: Unable to delete directory > /home/sb/p4/depot/someproj/MAIN/com.somecompany.someproj.somejnilib/target/tmplib > at > org.apache.maven.shared.model.fileset.util.FileSetManager.removeDir(FileSetManager.java:599) > at > org.apache.maven.shared.model.fileset.util.FileSetManager.removeDir(FileSetManager.java:574) > at > org.apache.maven.shared.model.fileset.util.FileSetManager.delete(FileSetManager.java:309) > at > org.apache.maven.plugin.clean.CleanMojo.removeDirectory(CleanMojo.java:261) > ... 19 more > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 2 seconds > [INFO] Finished at: Sun Dec 23 22:02:09 CET 2007 > [INFO] Final Memory: 8M/16M > [INFO] > ------------------------------------------------------------------------ > Compilation exited abnormally with code 1 at Sun Dec 23 22:02:11 -- 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