Maven Builds Fails After Upgrade

As far as I know, you can’t run use Java 8 to compile a Maven job type when the Jenkins controller requires Java 11. The Maven job type is tied to the version of Java running on the controller. That is one of the reasons that the Maven job type has been advised against for many years. You can read more about it in the “Risks” section of the Maven job documentation.

You can convert the Maven job types to be Pipeline jobs and then can use the JDK tool of your choice to run the Pipeline job.

You can convert the Maven job types to be freestyle jobs and then can use the JDK tool of your choice to run the Pipeline job.

You may also be able to modify the pom file definitions of the Maven jobs so that even though they compile with Java 11, they generate Java 8 byte code. If your strict requirement is that you must compile with Java 8, then as far as I know, you’ll need to use a different type of Jenkins job.