Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-42898

Jenkins Swarm jar is added to Maven Project classpath

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • maven-plugin, swarm-plugin
    • None
    • Master: CentOS 6.8, Oracle JDK 1.7
      Slave: CentOS 7, Oracle JDK 1.8.0_121 (both jenkins agent and this job)
      Jenkins: 2.50 (rpm)
      Plugin: Jenkins Swarm 3.3
      Plugin: Maven Integration 2.15.1
      Maven Version: any 3.x I tried.

      Apologies that I don't know whether this is an issue with Swarm or Maven plugin...

      When a slave started via jenkins swarm runs the main maven project build step (maven itself), the jenkins-swarm.jar (executable jar) is added to the classpath.  From what I can tell this has always been the case, but now it is a problem because the new version of the swarm jar (3.3) contains slf4j, and now our maven builds fail due to multiple versions of slf4j classes on the classpath.

      Since swarm 2.0 and 2.2 jar did not contain slf4j, this was not an issue.  

      Is the jar being added for a reason or am I misconfiguring something? 

       00:00:38.012 ERROR: Failed to parse POMs
       00:00:38.013 java.io.IOException: Remote call on Channel to Maven [/jdk-sun-1.8/bin/java, -XX:MaxPermSize=1024m, -Xmx1024m, -cp, /data/jenkins-slave/maven32-agent.jar:/data/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.5/boot/plexus-classworlds-2.5.2.jar:/data/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.5/conf/logging, jenkins.maven3.agent.Maven32Main, /data/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.5, /data/jenkins-slave/swarm-client-3.3.jar, /data/jenkins-slave/maven32-interceptor.jar, /data/jenkins-slave/maven3-interceptor-commons.jar, 42069] failed
       00:00:38.017 at hudson.remoting.Channel.call(Channel.java:838)
       00:00:38.017 at hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:161)
       00:00:38.017 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:873)
       00:00:38.018 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
       00:00:38.018 at hudson.model.Run.execute(Run.java:1728)
       00:00:38.019 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
       00:00:38.019 at hudson.model.ResourceController.execute(ResourceController.java:98)
       00:00:38.019 at hudson.model.Executor.run(Executor.java:405)
       00:00:38.020 Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
       00:00:38.022 at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:306)
       00:00:38.022 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
       00:00:38.023 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
       00:00:38.023 at hudson.maven.Maven3Builder$MavenExecutionListener.<init>(Maven3Builder.java:349)
       00:00:38.023 at hudson.maven.Maven3Builder$JenkinsEventSpy.<init>(Maven3Builder.java:201)
       00:00:38.023 at hudson.maven.Maven3Builder.call(Maven3Builder.java:119)
       00:00:38.024 at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
       00:00:38.024 at hudson.remoting.UserRequest.perform(UserRequest.java:153)
       00:00:38.025 at hudson.remoting.UserRequest.perform(UserRequest.java:50)
       00:00:38.025 at hudson.remoting.Request$2.run(Request.java:336)
       00:00:38.025 at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:68)
       00:00:38.026 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       00:00:38.026 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
       00:00:38.026 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
       00:00:38.027 at java.lang.Thread.run(Thread.java:745)
       00:00:38.027 at ......remote call to Channel to Maven [/jdk-sun-1.8/bin/java, -XX:MaxPermSize=1024m, -Xmx1024m, -cp, /data/jenkins-slave/maven32-agent.jar:/data/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.5/boot/plexus-classworlds-2.5.2.jar:/data/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.5/conf/logging, jenkins.maven3.agent.Maven32Main, /data/jenkins-slave/tools/hudson.tasks.Maven_MavenInstallation/Maven_3.2.5, /data/jenkins-slave/swarm-client-3.3.jar, /data/jenkins-slave/maven32-interceptor.jar, /data/jenkins-slave/maven3-interceptor-commons.jar, 42069](Native Method)
       00:00:38.030 at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1545)
       00:00:38.030 at hudson.remoting.UserResponse.retrieve(UserRequest.java:253)
       00:00:38.031 at hudson.remoting.Channel.call(Channel.java:830)
       00:00:38.031 ... 7 more

            Unassigned Unassigned
            akom Alexander Komarov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: