Build failed after upgrade to 2.479 with java 11

HI
after updating jenkins to version 2.479.2, I’m detecting that some builds that worked before now are failing. These are builds of projects built with java 11.
I’m new to jenkins, I understand that it is possible to run builds with versions of java different from those used by the controller and the agent.
I’m seeing the error on gmaven-plugin, it seems like a compatibility problem:

[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ XXXXXXXXXXXXXXX-war ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.2.1:enforce (enforce-maven) @ XXXXXXXXXXXXXXX-war ---
[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed
[INFO] 
[INFO] --- gmaven-plugin:1.5:execute (default) @ XXXXXXXXXXXXXXX-war ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.604 s
[INFO] Finished at: 2024-11-29T16:52:40+01:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "user-properties" could not be activated because it does not exist.
Waiting for Jenkins to finish collecting data
[ERROR] Failed to execute goal org.codehaus.gmaven:gmaven-plugin:1.5:execute (default) on project XXXXXXXXXXXXXXX-war: Execution default of goal org.codehaus.gmaven:gmaven-plugin:1.5:execute failed: An API incompatibility was encountered while executing org.codehaus.gmaven:gmaven-plugin:1.5:execute: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.gmaven:gmaven-plugin:1.5
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/fc/repository/org/codehaus/gmaven/gmaven-plugin/1.5/gmaven-plugin-1.5.jar
[ERROR] urls[1] = file:/fc/repository/org/codehaus/gmaven/runtime/gmaven-runtime-api/1.5/gmaven-runtime-api-1.5.jar
[ERROR] urls[2] = file:/fc/repository/org/codehaus/gmaven/feature/gmaven-feature-api/1.5/gmaven-feature-api-1.5.jar
[ERROR] urls[3] = file:/fc/repository/org/codehaus/gmaven/runtime/gmaven-runtime-loader/1.5/gmaven-runtime-loader-1.5.jar
[ERROR] urls[4] = file:/fc/repository/org/codehaus/gmaven/feature/gmaven-feature-support/1.5/gmaven-feature-support-1.5.jar
...
....
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>it.phoenixspa.inbank:XXXXXXXXXXXXXXX-war:2.114.0.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------: Unable to make protected void java.lang.Object.finalize() throws java.lang.Throwable accessible: module java.base does not "opens java.lang" to unnamed module @794f0b07
[ERROR] -> [Help 1]

I hope someone can help me.
Thank you

If those jobs are not Pipeline jobs and are not freestyle jobs, then you’re probably suffering from a limitation of the Maven integration job type. The Maven job type runs with the Java version that is used by the Jenkins agent that is running the build. The Maven integration job type documentation says:

The Jenkins project recommends that users transition from the Maven job type to use Pipeline jobs or freestyle jobs

That documentation then gives a detailed explanation why the Maven integration job type is not well suited to development and why you should migrate away from it.

The Pipeline Maven Integration plugin provides a path to Pipeline. You can also replace the Maven integration job type with sh or bat calls to invoke Apache Maven using the Jenkins tool wrappers to set Java version and Maven version.

1 Like

Thanks Mark. I forwarded the link to our developer group. To solve the issue we updated the plugins with most recent others, but I’d like change job type to avoid these issues in the future.
Regards