-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Microsoft Windows 7 64 bit
Jenkins 2.6.0 slave
jdk1.7.0_71
Artifactory Plugin 2.11.0
maven 3.5.0
After upgrading the Artifactory Plugin from 2.10.4 to 2.11.0 in every post build step the file 'm2.conf' gets deleted. This causes further build jobs to fail since the file is given via parameter 'Dclassworlds.conf' and is therefore neccessary to run maven.
To find the root cause of this problem we opened the file 'm2.conf' to hold a lock on it. This caused our build job to fail with the following details in the post build step
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 28.041 s [INFO] Finished at: 2017-05-22T13:17:34+02:00 [INFO] Final Memory: 60M/388M [INFO] ------------------------------------------------------------------------ FATAL: Could not delete temp file: C:\Program Files\Maven3\bin\m2.conf java.io.IOException: Could not delete temp file: C:\Program Files\Maven3\bin\m2.conf at org.jfrog.hudson.action.ActionableHelper.deleteFilePath(ActionableHelper.java:255) at org.jfrog.hudson.maven3.Maven3Builder.RunMaven(Maven3Builder.java:114) at org.jfrog.hudson.maven3.Maven3Builder.perform(Maven3Builder.java:90) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534) at hudson.model.Run.execute(Run.java:1733) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:405) Discard old builds... #321 is removed because old than numToKeep #320 is removed because old than numToKeep Finished: FAILURE
The following commit seems to cause this issue: https://github.com/JFrogDev/jenkins-artifactory-plugin/commit/1634b7138631d11b0bb60ef7a7fe930ea855938b
Related JIRA issue: https://www.jfrog.com/jira/projects/HAP/issues/HAP-917
We think that the deleteFilePathOnExit in Maven3Builder.java:184 should be moved into the 'if (artifactoryIntegration)' block beginning in line 166.
Workaround is reverting the Artifactory Plugin to version 2.10.4 or disabling the Plugin. Our assumption is that this bug only affects users who have installed the Artifactory Plugin but don't actually use it in any build.
martindoenicke,
Thanks for your detailed analysis.
You can track this issue in this JIRA.