Unable to delete pom.xml in Jenkins under Tomcat/Windows

I've been struggling with an annoying "Jenkins/Tomcat/Windows" problem for a while now without reaching any solution.

I've installed Tomcat version 7.0.25 in a Windows 7 Enterprise machine and Jenkins 1.451 as a webapplication running under Tomcat. I have just 4 jobs configured right now and all of then are using the "Always chekout a fresh copy" checkout strategy, so everytime a job runs the content in /jobs//workspace gets deleted. But, there are situations in which the job fails to run because it is unable to delete the /jobs//workspace/pom.xml file like you can see in this (edited) stacktrace:

Building in workspace C:\.hudson\jobs\<task name>\workspace
Cleaning local Directory .
java.io.IOException: Unable to delete C:\.hudson\jobs\<task name>\workspace\.\pom.xml
    at hudson.Util.deleteFile(Util.java:237)
    at hudson.Util.deleteRecursive(Util.java:287)
    at hudson.Util.deleteContentsRecursive(Util.java:198)
    at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:73)
    at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:136)
    at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:780)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:761)
    at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:745)
    at hudson.FilePath.act(FilePath.java:788)
    at hudson.FilePath.act(FilePath.java:770)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:735)
    at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:677)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1195)
    at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:576)
    at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:465)
    at hudson.model.Run.run(Run.java:1409)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:481)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:238)
Retrying after 10 seconds  

Here you can see Tomcat locking the file as I told:

After some time Jenkins/Tomcat releases the lock on the pom.xml and i can execute the job again without any problem.

Does anyone know how to get around this ? Am i missing something ? Thanks in advance!


I changed to Windows Service installation, and the pom.xml never gets locked anymore.

Seems that this caused by Tomcat that somehow locks the pom.xml, although the build has finished.

Need Your Help

Cross compiling from MinGW on Fedora 12 to Windows - console window?

qt4 mingw cross-compiling

After reading this article http://lukast.mediablog.sk/log/?p=155 I decided to use mingw on linux to compile windows applications. This means I can compile, test, debug and release directly from Lin...

c# WINFORM file asscociation issue

c# winforms

I have WinForm application which is almost ready to go for production and here is the problem that I am facing and I am not able to resolve it.