Reputation: 61
Did any one experience a similar problem like below or may share some thought on what possibly went wrong here:
Parsing POMs
FATAL: jenkins/mvn/GlobalMavenConfig
java.lang.NoClassDefFoundError: jenkins/mvn/GlobalMavenConfig
at hudson.maven.MavenModuleSet.getSettings(MavenModuleSet.java:663)
at hudson.maven.MavenModuleSetBuild$PomParser.<init>(MavenModuleSetBuild.java:1090)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.parsePoms(MavenModuleSetBuild.java:882)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:636)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:580)
at hudson.model.Run.execute(Run.java:1575)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Upvotes: 4
Views: 14426
Reputation: 5593
If your plugin requires a newer version of a jar that is already installed with Jenkins, most of the time you will run into conflict since Jenkins loads first by default. Per the Jenkins documentation, if you simply add the following Maven plugin and configuration to the build in the pom.xml of your Jenkins plugin, it will override the default behavior so the classes in your plugin jars are loaded first:
<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<configuration>
<pluginFirstClassLoader>true</pluginFirstClassLoader>
</configuration>
</plugin>
</plugins>
</build>
Upvotes: 0
Reputation: 8512
In general,
NoClassDefFoundError
in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available during compile time.
You may take a look at javadoc and great blog post.
It seems that version of maven-plugin in in <Full path to jenkins.war>/WEB-INF/plugins
is newer than version of jenkins-core in <Full path to jenkins.war>/WEB-INF/lib
and jenkins/mvn/GlobalMavenConfig was added in 1.515, so your maven-plugin version may be >= 1.515 and jenkins-core version may be < 1.515. Perhaps, you either followed steps that are mentioned here or there is something wrong with your jenkins.war.
How to verify it:
Check jenkins version and also jenkins-core-<your version>.jar
. You may found jenkins-core-<your version>.jar
in <Path to jenkins.war>/WEB-INF/lib/
folder. Classes for maven-plugin are in <Path to jenkins.war>/WEB-INF/plugins/maven-plugin/WEB-INF/lib/classes.jar
. Maven-plugin version mentioned in <Path to jenkins.war>/WEB-INF/plugins/maven-plugin/META-INF/MANIFEST.MF
.
How to fix it:
You may install latest version of jenkins or at least install correct maven-plugin.
Upvotes: 4