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

java.lang.NoClassDefFoundError: hudson/maven/MavenModuleSetBuild

      I'm using jenkins 1.466.2 via the regular Ubuntu packages on Ubuntu Quantla (12.10) with the copyArtifact plugin (version 1.25)

      The console output for the build of one of my Jenkins projects consistently shows this:

      Started by user Murray Cumming
      Building in workspace /var/lib/jenkins/workspace/maliit-plugins
      Checkout:maliit-plugins / /var/lib/jenkins/workspace/maliit-plugins - hudson.remoting.LocalChannel@35e47b48
      Using strategy: Default
      Last Built Revision: Revision 1004cc39badd17308a1fabfe0b72d1e762572b4b (origin/master)
      Fetching changes from 1 remote Git repository
      Fetching upstream changes from git://gitorious.org/maliit/maliit-plugins.git
      Commencing build of Revision 1004cc39badd17308a1fabfe0b72d1e762572b4b (origin/master)
      Checking out Revision 1004cc39badd17308a1fabfe0b72d1e762572b4b (origin/master)
      FATAL: hudson/maven/MavenModuleSetBuild
      java.lang.NoClassDefFoundError: hudson/maven/MavenModuleSetBuild
      at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:198)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
      at hudson.model.Build$RunnerImpl.build(Build.java:178)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:480)
      at hudson.model.Run.run(Run.java:1438)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:239)
      Caused by: java.lang.ClassNotFoundException: hudson.maven.MavenModuleSetBuild
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
      ... 10 more

          [JENKINS-15977] java.lang.NoClassDefFoundError: hudson/maven/MavenModuleSetBuild

          cjo9900 added a comment -

          Do you have the Maven plugin installed/enabled?
          As this copy artifact plugin depends on it, during compile time but there is no checking at runtime to see if it is installed before using it.

          as indicated in
          https://wiki.jenkins-ci.org/display/JENKINS/Dependencies+among+plugins

          so code needs to be added to do the check for the plugin before use

          if (Hudson.getInstance().getPlugin("maven-plugin") != null) {
          // use classes in the "maven-plugin" plugin
          }

          cjo9900 added a comment - Do you have the Maven plugin installed/enabled? As this copy artifact plugin depends on it, during compile time but there is no checking at runtime to see if it is installed before using it. as indicated in https://wiki.jenkins-ci.org/display/JENKINS/Dependencies+among+plugins so code needs to be added to do the check for the plugin before use if (Hudson.getInstance().getPlugin("maven-plugin") != null) { // use classes in the "maven-plugin" plugin }

          > Do you have the Maven plugin installed/enabled?

          No.

          I see several maven plugins on our pluginManager/available page. Which one do you you mean?

          Murray Cumming added a comment - > Do you have the Maven plugin installed/enabled? No. I see several maven plugins on our pluginManager/available page. Which one do you you mean?

          cjo9900 added a comment -

          The item is "Maven 2 Project Plugin" in the manage plugins pages, Is this listed as installed?

          As by default this is included in the Jenkins war file .

          cjo9900 added a comment - The item is "Maven 2 Project Plugin" in the manage plugins pages, Is this listed as installed? As by default this is included in the Jenkins war file .

          Thanks. No, that's not installed.

          I'll have to upgrade Jenkins to install that, because the pluginManager/available page says "Warning: This plugin is built for Jenkins 1.480.1 or newer. It may or may not work in your Jenkins."

          I'm using the standard Ubuntu 12.10 (Quantal) package. I'll try the http://pkg.jenkins-ci.org/debian/ packages

          Murray Cumming added a comment - Thanks. No, that's not installed. I'll have to upgrade Jenkins to install that, because the pluginManager/available page says "Warning: This plugin is built for Jenkins 1.480.1 or newer. It may or may not work in your Jenkins." I'm using the standard Ubuntu 12.10 (Quantal) package. I'll try the http://pkg.jenkins-ci.org/debian/ packages

          cjo9900 added a comment -

          Reproduced issue when maven-plugin is not installed.

          Pull request
          https://github.com/jenkinsci/copyartifact-plugin/pull/14

          cjo9900 added a comment - Reproduced issue when maven-plugin is not installed. Pull request https://github.com/jenkinsci/copyartifact-plugin/pull/14

          Yes, upgrading Jenkins seems to have fixed this. After upgrading to the jenkins.org .deb packages (1.493), there is no "Maven 2 Project plugin" available or installed, but the "Maven Integration plugin" seems to be installed by default.

          And my "Copy artifacts from another project" build step now works.

          Thanks.

          Murray Cumming added a comment - Yes, upgrading Jenkins seems to have fixed this. After upgrading to the jenkins.org .deb packages (1.493), there is no "Maven 2 Project plugin" available or installed, but the "Maven Integration plugin" seems to be installed by default. And my "Copy artifacts from another project" build step now works. Thanks.

          I just ran into this problem with Jenkins version 1.524:

          10:53:58 FATAL: hudson/maven/MavenModuleSetBuild
          10:53:58 java.lang.NoClassDefFoundError: hudson/maven/MavenModuleSetBuild
          10:53:58 at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:221)
          10:53:58 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
          10:53:58 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
          10:53:58 at hudson.model.Build$BuildExecution.build(Build.java:199)
          10:53:58 at hudson.model.Build$BuildExecution.doRun(Build.java:160)
          10:53:58 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
          10:53:58 at hudson.model.Run.execute(Run.java:1593)
          10:53:58 at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
          10:53:58 at hudson.model.ResourceController.execute(ResourceController.java:88)
          10:53:58 at hudson.model.Executor.run(Executor.java:247)
          10:53:58 Caused by: java.lang.ClassNotFoundException: hudson.maven.MavenModuleSetBuild
          10:53:58 at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
          10:53:58 at java.security.AccessController.doPrivileged(Native Method)
          10:53:58 at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
          10:53:58 at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
          10:53:58 at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
          10:53:58 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
          10:53:58 ... 10 more

          The problem was fixed by enabling the "Maven Integration plugin". I don't have any maven related configurations/jobs in this setup and therefore haven't had any Maven (related) plugins enabled so far, when upgrading from Jenkins 1.522 to 1.524 and also updating all related plugins this broke as noted above.

          Michael Prokop added a comment - I just ran into this problem with Jenkins version 1.524: 10:53:58 FATAL: hudson/maven/MavenModuleSetBuild 10:53:58 java.lang.NoClassDefFoundError: hudson/maven/MavenModuleSetBuild 10:53:58 at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:221) 10:53:58 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19) 10:53:58 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) 10:53:58 at hudson.model.Build$BuildExecution.build(Build.java:199) 10:53:58 at hudson.model.Build$BuildExecution.doRun(Build.java:160) 10:53:58 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586) 10:53:58 at hudson.model.Run.execute(Run.java:1593) 10:53:58 at hudson.matrix.MatrixRun.run(MatrixRun.java:146) 10:53:58 at hudson.model.ResourceController.execute(ResourceController.java:88) 10:53:58 at hudson.model.Executor.run(Executor.java:247) 10:53:58 Caused by: java.lang.ClassNotFoundException: hudson.maven.MavenModuleSetBuild 10:53:58 at java.net.URLClassLoader$1.run(URLClassLoader.java:217) 10:53:58 at java.security.AccessController.doPrivileged(Native Method) 10:53:58 at java.net.URLClassLoader.findClass(URLClassLoader.java:205) 10:53:58 at java.lang.ClassLoader.loadClass(ClassLoader.java:321) 10:53:58 at java.lang.ClassLoader.loadClass(ClassLoader.java:266) 10:53:58 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334) 10:53:58 ... 10 more The problem was fixed by enabling the "Maven Integration plugin". I don't have any maven related configurations/jobs in this setup and therefore haven't had any Maven (related) plugins enabled so far, when upgrading from Jenkins 1.522 to 1.524 and also updating all related plugins this broke as noted above.

          Bob Fields added a comment -

          I had the same problem: upgrade from 1.523 to 1.524, NoClassDefFoundError, Maven Integration Plugin no longer in the list of installed plugins. All of my projects (maven) and build history were also gone, with a message about changes stored on disk that could not be migrated to the current format (under 'Manage Old Data'). I re-installed the plugin (from Manage Jenkins -> Manage Plugins), and everything worked again.

          Bob Fields added a comment - I had the same problem: upgrade from 1.523 to 1.524, NoClassDefFoundError, Maven Integration Plugin no longer in the list of installed plugins. All of my projects (maven) and build history were also gone, with a message about changes stored on disk that could not be migrated to the current format (under 'Manage Old Data'). I re-installed the plugin (from Manage Jenkins -> Manage Plugins), and everything worked again.

          Code changed in jenkins
          User: cjo9900
          Path:
          src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
          http://jenkins-ci.org/commit/copyartifact-plugin/6cd2d83c58527c87cfbcc174fdbf6f5767c8dcbd
          Log:
          [FIXED JENKINS-15977] ClassNotFound is maven plugin not installed

          Check for the maven plugin being installed before trying to see
          if the project src is a maven project.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: cjo9900 Path: src/main/java/hudson/plugins/copyartifact/CopyArtifact.java http://jenkins-ci.org/commit/copyartifact-plugin/6cd2d83c58527c87cfbcc174fdbf6f5767c8dcbd Log: [FIXED JENKINS-15977] ClassNotFound is maven plugin not installed Check for the maven plugin being installed before trying to see if the project src is a maven project.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
          http://jenkins-ci.org/commit/copyartifact-plugin/d00c85521648361512e84ea0439ca6b1a95b9a4c
          Log:
          Merge pull request #14 from cjo9900/JENKINS-15977

          [FIXED JENKINS-15977] ClassNotFound is maven plugin not installed

          Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/7df40f147030...d00c85521648

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/CopyArtifact.java http://jenkins-ci.org/commit/copyartifact-plugin/d00c85521648361512e84ea0439ca6b1a95b9a4c Log: Merge pull request #14 from cjo9900/ JENKINS-15977 [FIXED JENKINS-15977] ClassNotFound is maven plugin not installed Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/7df40f147030...d00c85521648

            Unassigned Unassigned
            murrayc Murray Cumming
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: