I'm experiencing a similar problem. I use Ivy 2.4.0 in my build process, and the Artifactory plugin is overriding it with Ivy 2.2.0:
resolve:
[ivy:resolve] :: Ivy 2.2.0 - 20100923230623 :: http:[ivy:resolve] :: loading settings :: url = jar:file:/usr/share/tomcat8/.jenkins/cache/artifactory-plugin/2.4.7/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[buildinfo:ant] Added resolution report Ivy Listener.
...
Worse yet, other ancient jar files in the artifactory-plugin lib folder (e.g., guava-r08.jar) are overriding jar files in other plugins (i.e., checkstyle, which requires guava-17.0.jar), resulting in build failures:
/usr/share/tomcat8/.jenkins/jobs/util/workspace/build.xml:164: java.lang.NoSuchMethodError: com.google.common.io.Closeables.closeQuietly(Ljava/io/InputStream;)V
at com.puppycrawl.tools.checkstyle.PackageNamesLoader.getPackageNames(PackageNamesLoader.java:156)
at com.puppycrawl.tools.checkstyle.Checker.finishLocalSetup(Checker.java:137)
at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:136)
at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createChecker(CheckstyleAntTask.java:413)
at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.realExecute(CheckstyleAntTask.java:320)
at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.execute(CheckstyleAntTask.java:303)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.Main.runBuild(Main.java:853)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)
If I disable artifactory-plugin, my jenkins build environment is identical to my local build environment, and checkstyle works without problems.
Why is artifactory-plugin taking over the entire build environment?
I believe this problem is related to JENKINS-23794.
The workaround I've found (in my case), is to simply delete the obsolete jar files from the plugin directory:
.jenkins/plugins/artifactory/WEB-INF/lib/ivy-2.2.0.jar
.jenkins/plugins/artifactory/WEB-INF/lib/guava-r08.jar
and then also delete the entire artifactory cache:
.jenkins/artifactory-plugin
and then re-run the build. Depending on which plugins are used, some other obsolete jar files may also need to be deleted (e.g., commons-lang, commons-logging, jdom, http-client) - some of these are over 10 years out of date.
We use ivy version 2.3 and the inclusion of ivy 2.2 causes obscure build failures which are difficult to attribute to artifactory-plugin. Sounds like unrelated ivy issues so tracking down the root cause is most time consuming. Fix is messy!
We would suggest a configuration option which would allow us to specify which version of ivy to include in any and where to get the jar file. For us it would be fine to be server configuration rather than job configuration as we have standardized on the version of ivy which goes with our ant version (also standardized).