Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Compiler plugin 4.0.0-beta 3 has been released in October.

...

When used with the maven-compiler-plugin version 4.0.0-beta-3 (not yet released at the time of writing this wikireleased in October 15th, 2025), the plugin automatically performs the following steps, in that order:

...

TODO (May 2023): This rest of this section may need to be reviewed for taking in account what exist in Maven 4.0.0-rc-3 and maven-compiler-plugin 4.0.0-beta-3-SNAPSHOT.

The following needs to be summarized (TBD):
Furthermore if you have several JDK versions for example; you have one non-version dependendat maybe just JDK 8 based and version dependant parts for version 11,17,21,22 so you need for each version separated test/main code + resources and also you might require different deps for different jdk versions... (as already suggested).
But on the other hand we could think about a packaging type "multi-release" which automatically defines a default directory layout (as suggested src/main/java/.. base version.. and "src/main/java11/ for JDK 11 etc. also the resources like src/main/resources11/.. and for src/test/java11 etc. the same way)...
Those diretories could automatically trigger the appropriate --release option (The default is defined by the usual configuration of maven-compiler-plugin --release also associated with src/main/java;) so if you create a directory src/main/java21 it will be compiled via --release 21...That would just remove the requirement to define all those things in your pom file by hand..(and might be more following the idea convention over configuration)..
The same way for the the src/test/java21 ...A not trivial thing is about things like code coverage how to handle things in that setup? Also how to run tests only limited to a JDK 21 code area which might be require code from the default area (src/main/java). And how could it be handled to have different deps in different code areas (JDK 21 requires for testing a different library?) and in case of code coverage we require the agents (or even other tools?) ? and let later combine them into a single one...Those thoughs are bringing me at the moment to go into the multi module setup which solves already a lot of those issues...(current setup not convenient of course)... and also keep the flexibility ...

...

TODO (May 2023): This section may be obsolete. The code in Maven 4.0.0-rc-3 and maven-compiler-plugin 4.0.0-beta-3 -SNAPSHOT do not need a particular packing type for multi-release support.

...