[HAP-933] m2.conf file is being deleted and causes maven builds to fail Created: 23/May/17  Updated: 29/Jun/17  Resolved: 29/Jun/17

Status: Resolved
Project: Jenkins Artifactory Plug-in
Component/s: Maven2, Maven3
Affects Version/s: None
Fix Version/s: 2.12.0

Type: Bug Priority: High
Reporter: Yahav Itzhak Assignee: Yahav Itzhak
Resolution: Fixed Votes: 0
Labels: None


Maven plugin m2.conf file is being deleted after freestyle maven project without 'Maven3-Artifactory Integration'. As a result, consecutive Maven builds fails.
The root cause is a change in HAP-917 and in this commit. After each maven build the 'classwords' file is deleted but in case of non 'Maven3-Artifactory Integration', the 'classwords' file defined to be the m2.conf.

Jenkins Jira ticket:

Comment by Yahav Itzhak [ 23/May/17 ]

We fixed the issue. Here is the link to the commit:
Here is a download link for a snapshot version which includes the fix:

Comment by Nikolas Falco [ 23/May/17 ]

In our case, the file was deleted with success corrupting that maven tool so any job that use the same maven tool fail with

java.io.FileNotFoundException: /var/lib/jenkins/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.3/bin/m2.conf (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at java.io.FileInputStream.<init>(FileInputStream.java:93)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:390)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Build step 'Invoke Artifactory Maven 3' changed build result to FAILURE
Build step 'Invoke Artifactory Maven 3' marked build as failure

I can confirm that the attached snapshot works.
Anyway the last year every update of these plugins (quite the same for cocoapods) to use the pro features contains easter eggs.
It is a good idea add unit test to avoid these regression in the future becuase the actual coverage is 0% shown in this picture (measured by jacoco)

Generated at Mon Jun 01 20:44:59 UTC 2020 using Jira 8.5.3#805003-sha1:b4933e02eaff29a49114274fe59e1f99d9d963d7.