I have long struggled with the annoying Jenkins / Tomcat / Windows problem without reaching any solution.
I installed Tomcat version 7.0.25 on a Windows 7 Enterprise machine and Jenkins 1.451 as a web application running Tomcat. Right now I have only 4 jobs, and they all use the Always Chekout a fresh copy check strategy, so whenever a job launches content in / jobs // the workspace is deleted. But there are situations where the work is not performed because it cannot delete the /jobs//workspace/pom.xml file, as 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 how Tomcat locks the file, as I said:

After a while, Jenkins / Tomcat releases the lock on pom.xml and I can run the job again without any problems.
Does anyone know how to get around this? Am I missing something? Thanks in advance!
source share