Re: Maven Compiler Plugin: Not respecting testRelease flag?

Martin Desruisseaux <[email protected]> Fri, 24 Oct 2025 10:13:47 +0200
Newsgroups gmane.comp.jakarta.turbine.maven.user
Message-ID <[email protected]>
Le 24/10/2025 à 01:57, Polarian a écrit :

> A little side question then, is there any benefit of setting the target
> Java version within the maven compiler plugin or is it just best to
> always use JAVA_HOME to decide (as the JDK version will the default
> version)?

I would suggest to set the target Java version instead, and use 
JAVA_HOME only in last resort. It is not only easier, but may also be 
safer since the compiler of old releases may have unfixed issues if 
unmaintained (e.g., javadoc generating HTML pages with a vulnerability 
in the JavaScript code). If a project cannot compile or run without a 
specific JAVA_HOME, it is probably because they are using internal API, 
which is a deprecated practice and normally not allowed anymore if they 
were using the Java Module system.

     Martin