[ 
https://jira.codehaus.org/browse/CONTINUUM-1156?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=326597#comment-326597
 ] 

Brent N Atkinson commented on CONTINUUM-1156:
---------------------------------------------

I can't reproduce this on trunk@r1491782. I used a shell project that contained 
the following script only:

{code:sh}
#!/bin/bash

mkdir test_clean
echo > test_clean/1
echo > test_clean/2
ln -s 2 test_clean/3
{code}

I then set the project to 'Build Fresh'. I edited the working copy's 
test_clean/2 file and triggered the build again. The logs show that the 
clean-working-directory action is executed and when I check the timestamps and 
contents of the working directory it is a different timestamp and empty 
contents again.
                
> Continuum will not successfully delete build directories containing symbolic 
> links
> ----------------------------------------------------------------------------------
>
>                 Key: CONTINUUM-1156
>                 URL: https://jira.codehaus.org/browse/CONTINUUM-1156
>             Project: Continuum
>          Issue Type: Bug
>          Components: Core system
>    Affects Versions: 1.1-alpha-1
>         Environment: Linux Fedora Core 5
>            Reporter: Steve Pietrowicz
>             Fix For: 1.4.2
>
>         Attachments: ContinuumFileUtils.java
>
>
> FileUtils.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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to