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

Error when compiling a plugin against jenkins version 1.463

    XMLWordPrintable

Details

    Description

      While investigating a plugin issue which was introduced with version 1.463 of jenkins I found out that it is impossible to build any plugin against this version.
      Even the default plugin generated by mvn hpi:create does not build anymore, after you select 1.463 in the pom.xml.

      The build fails with the following exception:

      [INFO] Compiling 1 source file to /home/steven/tmp/test/test/target/classes
      [INFO] -------------------------------------------------------------
      [ERROR] COMPILATION ERROR : 
      [INFO] -------------------------------------------------------------
      [ERROR] error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap
      [INFO] 1 error
      [INFO] -------------------------------------------------------------
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Compilation failure
      error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap
      
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      
      org.apache.maven.BuildFailureException: Compilation failure
      error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap
      
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
              at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
              at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
              at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
              at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
              at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
              at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
              at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
      error: Exception thrown while constructing Processor object: com/google/common/collect/Multimap
      
              at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
              at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
              at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
              at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
              ... 17 more
      

      I am not a mvn expert but adding the latests guava.jar to the classpath of the javac fixes the problem.

      I assume that this problem was introduced in version 1.463 as it does not exist in 1.462.

      Attachments

        Activity

          jglick Jesse Glick added a comment -

          Would rather not leave Maven 2 workarounds in every plugin, especially as this dependency could easily be rendered stale by a core update.

          Perhaps put an enforcer rule in the archetypal POM requiring Maven 3.0.4+, but with a comment linking to this issue explaining how you can make it work on Maven 2 if you need to.

          jglick Jesse Glick added a comment - Would rather not leave Maven 2 workarounds in every plugin, especially as this dependency could easily be rendered stale by a core update. Perhaps put an enforcer rule in the archetypal POM requiring Maven 3.0.4+, but with a comment linking to this issue explaining how you can make it work on Maven 2 if you need to.

          I had the same issue with IntelliJ. In my case, from the project setting, "Compiler > Annotation Processors > Enable annotation processing" fixed the problem (but I don't know why.)

          kohsuke Kohsuke Kawaguchi added a comment - I had the same issue with IntelliJ. In my case, from the project setting, "Compiler > Annotation Processors > Enable annotation processing" fixed the problem (but I don't know why.)

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/pom.xml
          maven-plugin/pom.xml
          http://jenkins-ci.org/commit/jenkins/abeebce2230c37c1ad6bd6b5d5af615859980568
          Log:
          [FIXED JENKINS-13754]

          while I can't pinpoint what's really causing this, moving this
          dependency to core seems to solve the problem.

          Guava is defined as dependency in org.kohsuke.stapler:stapler, then
          redefined to a newer version in maven-plugin. The latter gets to plugins
          as a test scope. When I look at the dependency scope of this in a plugin
          project in IntelliJ IDEA, it reports this dependency as the test scope
          (and this makes the error somewhat understandable.)

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/pom.xml maven-plugin/pom.xml http://jenkins-ci.org/commit/jenkins/abeebce2230c37c1ad6bd6b5d5af615859980568 Log: [FIXED JENKINS-13754] while I can't pinpoint what's really causing this, moving this dependency to core seems to solve the problem. Guava is defined as dependency in org.kohsuke.stapler:stapler, then redefined to a newer version in maven-plugin. The latter gets to plugins as a test scope. When I look at the dependency scope of this in a plugin project in IntelliJ IDEA, it reports this dependency as the test scope (and this makes the error somewhat understandable.)
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #2041
          [FIXED JENKINS-13754] (Revision abeebce2230c37c1ad6bd6b5d5af615859980568)

          Result = SUCCESS
          kohsuke : abeebce2230c37c1ad6bd6b5d5af615859980568
          Files :

          • core/pom.xml
          • maven-plugin/pom.xml
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2041 [FIXED JENKINS-13754] (Revision abeebce2230c37c1ad6bd6b5d5af615859980568) Result = SUCCESS kohsuke : abeebce2230c37c1ad6bd6b5d5af615859980568 Files : core/pom.xml maven-plugin/pom.xml

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          pom.xml
          http://jenkins-ci.org/commit/maven-plugin/56cf6e330d7165e714238b14510521c2ab8880ee
          Log:
          [FIXED JENKINS-13754]

          while I can't pinpoint what's really causing this, moving this
          dependency to core seems to solve the problem.

          Guava is defined as dependency in org.kohsuke.stapler:stapler, then
          redefined to a newer version in maven-plugin. The latter gets to plugins
          as a test scope. When I look at the dependency scope of this in a plugin
          project in IntelliJ IDEA, it reports this dependency as the test scope
          (and this makes the error somewhat understandable.)

          Originally-Committed-As: abeebce2230c37c1ad6bd6b5d5af615859980568

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: pom.xml http://jenkins-ci.org/commit/maven-plugin/56cf6e330d7165e714238b14510521c2ab8880ee Log: [FIXED JENKINS-13754] while I can't pinpoint what's really causing this, moving this dependency to core seems to solve the problem. Guava is defined as dependency in org.kohsuke.stapler:stapler, then redefined to a newer version in maven-plugin. The latter gets to plugins as a test scope. When I look at the dependency scope of this in a plugin project in IntelliJ IDEA, it reports this dependency as the test scope (and this makes the error somewhat understandable.) Originally-Committed-As: abeebce2230c37c1ad6bd6b5d5af615859980568

          People

            Unassigned Unassigned
            steven_aerts Steven Aerts
            Votes:
            4 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: