Maven Core Runtime Requirement Changes to Java 17 in Maven 4.0.0
0 reputation · 02 May 2020, 18:00 UTC
The goal is to understand whether a Maven 4.0.0 build can continue to compile source code with Java 8 while the Maven process itself runs on Java 17, using the toolchains mechanism to decouple the compilation JDK from the runtime JDK. Maven 4.0.0 enforces a hard runtime baseline of Java 17, but the toolchains.xml configuration can still declare a Java 8 toolchain for the maven-compiler-plugin. This does not change the JVM used to launch Maven, and projects that rely on the maven-wrapper may automatically upgrade to a 4.x distribution, breaking CI images that only provide Java 8 or 11.
Uncertainty remains about which core or third‑party plugins require recompilation against the new maven‑plugin‑api 4.0 and whether declaring a Java 8 toolchain guarantees successful compilation when those plugins are loaded. Additionally, teams need a way to verify plugin compatibility before promoting the wrapper to a 4.x version without introducing build failures. Does declaring a Java 8 toolchain in toolchains.xml allow successful compilation when Maven 4 runs on Java 17? Which plugins are known to require a 4.x‑compatible artifact? How can a team verify plugin compatibility before upgrading the maven-wrapper distributionUrl?