[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


 Description   

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:
https://issues.jenkins-ci.org/browse/JENKINS-44418



 Comments   
Comment by Yahav Itzhak [ 23/May/17 ]

We fixed the issue. Here is the link to the commit:
https://github.com/JFrogDev/jenkins-artifactory-plugin/commit/69e1db7ea85486a5dc73491b77c91f32ed4482b2
Here is a download link for a snapshot version which includes the fix:
https://oss.jfrog.org/oss-snapshot-local/org/jenkins-ci/plugins/artifactory/2.12.x-SNAPSHOT/artifactory-2.12.x-20170523.123909-2.hpi

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 Sun Oct 20 06:49:30 UTC 2019 using JIRA 7.6.16#76018-sha1:9ed376192612a49536ac834c64177a0fed6290f5.