Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.1-alpha-1
-
None
-
Linux Fedora Core 5
-
Patch
Description
1FileUtils.cleanDirectory() will not remove symbolic links if they are located in the directory that it is trying to clean.
This occurs for me when you set up a Shell project with the "Build Fresh" option checked.
The project I'm building is invoked with a shell script. I download the shell script through continuum and it kicks off the first build successfully.
On the next scheduled build, the following message occurs:
—
org.codehaus.plexus.taskqueue.execution.TaskExecutionException: Error executing action 'clean-working-directory'
at org.apache.maven.continuum.buildcontroller.DefaultBuildController.performAction(DefaultBuildController.java:432)
at org.apache.maven.continuum.buildcontroller.DefaultBuildController.cleanWorkingDirectory(DefaultBuildController.java:361)
at org.apache.maven.continuum.buildcontroller.DefaultBuildController.build(DefaultBuildController.java:103)
at org.apache.maven.continuum.buildcontroller.BuildProjectTaskExecutor.executeTask(BuildProjectTaskExecutor.java:50)
at org.codehaus.plexus.taskqueue.execution.ThreadedTaskQueueExecutor$ExecutorRunnable$1.run(ThreadedTaskQueueExecutor.java:116)
at edu.emory.mathcs.backport.java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:987)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:528)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.io.IOException: Directory /scratch/home/srp/tomcat/apache-tomcat-5.5.17/webapps/continuum/WEB-INF/working-directory/1/dir/Linux/external/TclTk/8.5a4/bin unable to be deleted.
at org.codehaus.plexus.util.FileUtils.deleteDirectory(FileUtils.java:1332)
at org.codehaus.plexus.util.FileUtils.forceDelete(FileUtils.java:1158)
at org.codehaus.plexus.util.FileUtils.cleanDirectory(FileUtils.java:1371)
at org.codehaus.plexus.util.FileUtils.deleteDirectory(FileUtils.java:1328)
at org.codehaus.plexus.util.FileUtils.forceDelete(FileUtils.java:1158)
at org.codehaus.plexus.util.FileUtils.cleanDirectory(FileUtils.java:1371)
at org.codehaus.plexus.util.FileUtils.deleteDirectory(FileUtils.java:1328)
at org.codehaus.plexus.util.FileUtils.forceDelete(FileUtils.java:1158)
at org.codehaus.plexus.util.FileUtils.cleanDirectory(FileUtils.java:1371)
at org.codehaus.plexus.util.FileUtils.deleteDirectory(FileUtils.java:1328)
at org.codehaus.plexus.util.FileUtils.forceDelete(FileUtils.java:1158)
at org.codehaus.plexus.util.FileUtils.cleanDirectory(FileUtils.java:1371)
at org.codehaus.plexus.util.FileUtils.deleteDirectory(FileUtils.java:1328)
at org.codehaus.plexus.util.FileUtils.forceDelete(FileUtils.java:1158)
at org.codehaus.plexus.util.FileUtils.cleanDirectory(FileUtils.java:1371)
at org.codehaus.plexus.util.FileUtils.deleteDirectory(FileUtils.java:1328)
at org.codehaus.plexus.util.FileUtils.forceDelete(FileUtils.java:1158)
at org.codehaus.plexus.util.FileUtils.cleanDirectory(FileUtils.java:1371)
at org.apache.maven.continuum.core.action.CleanWorkingDirectoryAction.execute(CleanWorkingDirectoryAction.java:60)
at org.apache.maven.continuum.buildcontroller.DefaultBuildController.performAction(DefaultBuildController.java:406)
... 9 more
–
A search in the directory mentioned above show a symbolic link that hasn't been deleted.
The problem occurs because the Plexus class FileUtils.cleanDirectory() doesn't work as advertised. I reported that bug on the Plexu Utils Jira, which you can see here:
http://jira.codehaus.org/browse/PLXUTILS-28
I was able to incorporate the fix in Continuum by creating a new class ContinuumFileUtils, and changed all occurances of FileUtils.cleanDirectory to call the new class instead. I've uploaded a copy of the file along with this bug report.
While I think it's likely that this bug will eventually get fixed in Plexus, it's breaking Continuum builds now, so I think this needs to be fixed.
Attachments
Attachments
Issue Links
- is duplicated by
-
CONTINUUM-1900 cleanup project fails when symbolic links are used
- Closed
- relates to
-
CONTINUUM-1790 Directory symlinks traversed on deletion
- Closed
-
CONTINUUM-2119 Cleaning up large working directories fails with OutOfMemoryError
- Closed