chadlwilson opened a new issue, #3382:
URL: https://github.com/apache/maven-surefire/issues/3382

   ### Affected version
   
   3.5.6
   
   ### Bug description
   
   When using the maven-toolchains-plugin auto discovery mechanism, surefire's 
`jvmToolchain`  does not appear able to sleep tone if the auto-discivered 
toolchains. It only seems to work with one statically defined in toolchains.xml 
which defeats the purpose of auto-discovery.
   
   Not sure if this is due to a lifecycle constraint within Maven, or the 
toolchains plugin auto-discovery - or surefire itself. Manually binding the 
auto-discovery to before-test-classes somewhat allows to workaround,.but that 
changes the default toolchain for any phase after that, which is not desirable 
as the toolchain selection is no longer scoped to the specific plugin.
   
   The use case here is common - run Maven, plugins and perhaps compilation 
with (say) Java 25, but execute tests using an older JVM (say 11).
   - allows use of modern compiler targeting older JVM to ensure newer Java 
eprecations are addressed
   - allows plugins which require a higher JVM than your target Java version to 
run (e.g. modern `maven-bundle-plugin` needs Java 17) with restricting testing
   - ensures code actually runs on older JVMs to handle JVM-specific runtime 
semantics correctly
   
   Apologies if this is a duplicate, the toolchains documentation is not great, 
and intent is hard to decipher.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to