# Jenkins-Maven builds are failing after Jenkins upgrade version 2.332.3

**URL:** <https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631>\
**Category:** Using Jenkins\
**Created:** [February 6, 2023, 3:49pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631 "2023-02-06T15:49:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thatsenthil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/thatsenthil/32/3283_2.png) [@thatsenthil](https://community.jenkins.io/u/thatsenthil)\
**Post date:** [February 6, 2023, 3:49pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631/1 "2023-02-06T15:49:15Z")

</div>

Hi Team,

Maven builds (JDK 8) are failing with the below error after upgrading to Jenkins(JDK 11) version 2.332.3.

I had already installed JDK 8, JDK11(mandatory for Jenkins version 2.332.3) on the Jenkins server.  
Also, Configured both JDK with label JDK8 and JDK 11 on Global tools Config.

While running Maven Project Build, I chooses JDK 8 for build but I am getting below error…

Error:  
“ **C:\Program Files\Java\jdk1.8.0\_91/bin/java** ” -cp D:\data\sl16vmhg-jenkins-slave\maven35-agent.jar;D:\data\sl16vmhg-jenkins-slave\tools\hudson.tasks.Maven\_MavenInstallation\maven-3.5.2\boot\plexus-classworlds-2.5.2.jar;D:\data\sl16vmhg-jenkins-slave\tools\hudson.tasks.Maven\_MavenInstallation\maven-3.5.2/conf/logging jenkins.maven3.agent.Maven35Main D:\data\sl16vmhg-jenkins-slave\tools\hudson.tasks.Maven\_MavenInstallation\maven-3.5.2 D:\data\sl16vmhg-jenkins-slave\slave.jar D:\data\sl16vmhg-jenkins-slave\maven35-interceptor.jar D:\data\sl16vmhg-jenkins-slave\maven3-interceptor-commons.jar 54939

**Exception in thread “main” java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0**

I had also tried to use JDK11, then I am getting the compilation error due to JDK11 as our code in JDK8.

ERROR:  
“ **C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot/bin/java** ” -cp D:\data\sl16vmhg-jenkins-slave\maven35-agent.jar;D:\data\sl16vmhg-jenkins-slave\tools\hudson.tasks.Maven\_MavenInstallation\maven-3.5.2\boot\plexus-classworlds-2.5.2.jar;D:\data\sl16vmhg-jenkins-slave\tools\hudson.tasks.Maven\_MavenInstallation\maven-3.5.2/conf/logging jenkins.maven3.agent.Maven35Main D:\data\sl16vmhg-jenkins-slave\tools\hudson.tasks.Maven\_MavenInstallation\maven-3.5.2 D:\data\sl16vmhg-jenkins-slave\slave.jar D:\data\sl16vmhg-jenkins-slave\maven35-interceptor.jar D:\data\sl16vmhg-jenkins-slave\maven3-interceptor-commons.jar 54942

\*\*[ERROR] COMPILATION ERROR : \*\*  
**package javax.xml.soap does not exist**

I had also tried to override the node properties set as JDK8 on master node and ran maven jobs but failed with the same error.  
I would like to use JDK8 for Jenkins Maven project? Please advise.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [February 6, 2023, 4:45pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631/2 "2023-02-06T16:45:54Z")

</div>

More details and a link to a very good page that outlines alternatives is included in this previous answer:

> [@Maven Builds Fails After Upgrade](https://community.jenkins.io/t/maven-builds-fails-after-upgrade/3850):
>
> Hello, we have upgraded Jenkins to the latest version, but instead of changing default java version from 8 to 11, we set path to java 11 for Jenkins from systemd files, Jenkins starts normally and all looks fine but when we run jobs with maven builds they are failing with following message: [workspace] $ java -cp /var/lib/jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.13.jar:/usr/share/maven/boot/plexus-classworlds-2.x.jar:/usr/share/maven/conf/logging jenkins.maven3.agent.Maven35Mai…

The maven job type is not a good choice. You need to transition those jobs to a different job type. Most of them are transitioning to Pipeline job types so that they can continue to build with their preferred JDK no matter which JDK is running the Jenkins controller.

You can read more about why it is not a good choice in the “Risks” section of the maven plugin documentation:

> **[Maven Integration](https://plugins.jenkins.io/maven-plugin/#plugin-content-risks)**
>
> This plugin provides a deep integration between Jenkins and Maven. It adds support for automatic triggers between projects depending on SNAPSHOTs as well as the automated configuration of various Jenkins publishers such as Junit.

---

<div class="post-metadata">

**Author:** ![thatsenthil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/thatsenthil/32/3283_2.png) [@thatsenthil](https://community.jenkins.io/u/thatsenthil)\
**Post date:** [February 18, 2023, 5:44pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631/3 "2023-02-18T17:44:33Z")

</div>

Thanks for the suggestion.  
After converting into freesyle project, getting the below error.

Downloading from RedHat-Repo: [https://maven.repository.redhat.com/ga/jdk/tools/5.0/tools-5.0.pom](https://maven.repository.redhat.com/ga/jdk/tools/5.0/tools-5.0.pom) Downloading from central: [https://repo.maven.apache.org/maven2/jdk/tools/5.0/tools-5.0.pom](https://repo.maven.apache.org/maven2/jdk/tools/5.0/tools-5.0.pom)

fortify-maven-plugin:1.0.13:cloudscan failed.: NullPointerException → [Help 1]

I have already mentioned the plugin in the pom.xml file and I could see jar file in m2directory of the server. Please advise.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [February 18, 2023, 7:22pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631/4 "2023-02-18T19:22:49Z")

</div>

I believe that is an issue related to something inside the Maven plugin named `fortify-maven-plugin`. It is not something that I recognize or can help. You may want to check for a newer version of the `fortify-maven-plugin`. I don’t see that mentioned as a publicly available maven plugin.

---

<div class="post-metadata">

**Author:** ![thatsenthil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/thatsenthil/32/3283_2.png) [@thatsenthil](https://community.jenkins.io/u/thatsenthil)\
**Post date:** [February 20, 2023, 7:32pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631/5 "2023-02-20T19:32:11Z")

</div>

Thanks Mark.  
Does Jenkins Free style project support Dynamic parent pom version?  
I am getting an error in my child pom where the value of “REVISION” is not populating  
Failed to build parent project for com.XX.XXX:master-platform:war:2.4.${REVISION}

Worked fine in maven project.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [February 20, 2023, 10:02pm UTC](https://community.jenkins.io/t/jenkins-maven-builds-are-failing-after-jenkins-upgrade-version-2-332-3/5631/6 "2023-02-20T22:02:50Z")

</div>

> [@thatsenthil](#):
>
> Does Jenkins Free style project support Dynamic parent pom version?

I doubt that it supports anything specific to maven projects, though the maven step inside a freestyle project may have some things where it helps.

The documentation for the maven integration plugin warns:

> There are multiple ways to build a Maven project with Jenkins:
> 
> - Use a free-style project with a Maven build step
> - Use a Maven-style project
> - Use a Pipeline project with a shell, batch, or powershell build step that calls Maven
> 
> The first way runs the build as Maven intended. The second way adds a whole lot of hooks and can even modify the build in ways that Maven did not intend.
> 
> The first way requires that you configure stuff yourself. The second way tries to “guess” what you want and auto-configure it.
> 
> The first way is initially less user friendly, i.e. you have more UI to click through to get the full set of reports. The second way is initially more user friendly… but when things go wrong… well sorry out of luck.
> 
> If something goes wrong with the first way, worst case you add a shell build step above the Maven build step that just runs SET, trigger a build, login to the build agent, switch to the user the build is running as, apply the environment your SET build step output and then run the Maven command that the build’s console log captured. That will give you an exact reproduction of the Maven build and you can debug why your build is not working. When something goes wrong with the second way, well good luck. By all means try to do the same as you would for a freestyle project, but at the end of the day, there is no way you can replicate the injected hooks that Jenkins puts into your Maven build. You can get an approximate reproduction, and hey, that may just be enough to let you figure out what is wrong and fix your build… but there are cases where you cannot.

I suspect that there is a way from the maven command line to perform the operation that you want. Use the maven command line to perform that task and freestyle or Pipeline will work for you.
