Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
3.1.0
-
None
-
None
Description
Currently it is needed to have the toolchains defined in the toolchains.xml file. The Maven Docker images do not include a useful toolchains file. But since it’s possible to derive a usable toolchain from the system properties, it should not be required to store that information in the toolchains.xml file. Instead, Maven should check if the toolchain request could be fulfilled by the JDK running Maven.
I’m not sure if it’s reasonable to do this in all cases or only if the toolchains file does not contain any toolchain. For example, if the toolchains file only contains a Java 16 toolchain and the project requires Java 17 (exactly, not 17 or later) and Maven is run with Java 17, it would be possible to build the project (with Java 17), but probably not a good idea since it will fail when the Java installation Maven is running on is updated to version 18.