Hi all,

just have joined this group by today - so maybe my question might have been 
discussed already but within a few minutes I could not find much on this - 
so would like to check on this topic within this group.

As far as I see the Jenkins CI infrastructure plugins build jobs are 
running for different Java JDK versions - currently for Java 17 and Java 21 
as far as I could see.

On the other hand side the current POM is defining java level 11, BUT it is 
not making use of the Maven toolchain plugin.

IMHO this is not best practice, since the classes will be compiled to 
comply with the Java level defined by the POM, BUT the ompile reference to 
java runtime/bootstrap API is to the Java level of the JDK version running 
the Maven build job.

This implies the risk that code could make use of higher level Java APIs 
and would compile well, but if this code is running on a lower level java 
runtime matching the classes level signature it will fail, since that API 
does not exist in the lower level runtime.

For that reason Maven is providing the toolchain plugin.
The toolchain plugin enables to compile with the toolchain specified JDK 
version - which can differ from the Maven job runtime JDK.
Same for JUnit testing via surefire plugin.

Is there a reason why Jenkins POM definitions are not making use of it?

Kind regards
Markus

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/1569c8d2-8d74-4a5a-b4d8-4dbd49c39b9cn%40googlegroups.com.

Reply via email to