-
Notifications
You must be signed in to change notification settings - Fork 0
Changes in compiler parameters
In its current version, the new plugin does not remove any parameters that exist in the compiler plugin of Maven 3. However, the behaviour of some parameters has been modified and some parameters are deprecated. This page lists the changes.
The set of plugin parameters is the same as before: no addition and no removal, but there is some deprecations. The following parameters are deprecated but are still working:
-
<compilerArgument>: already replaced by<compilerArgs>since Maven 3.1. The replacement uses a list of strings instead of a single string. -
<annotationProcessorPaths>: replaced by ordinary dependencies with<type>proc</type>. The latter is a new artifact type introduced in Maven 4-alpha13.
The following parameters are marked as deprecated for removal. They all became no-op in the new plugin:
-
<forceJavacCompilerUse>: the documentation is not really explicit, but this parameters seems to be about forcing the use ofjava.lang.CompilerAPI instead ofjavax.tools.JavaCompiler. The former class was deprecated since Java 9 and no longer exists in Java 21. -
<outputFileName>: producing the final JAR file can be considered as the task of separated plugins, for example the JAR plugin. Furthermore, this parameter does not work well in the context of Module Source Hierarchy, because the output is not a single JAR file. -
<compilerReuseStrategy>: does not apply well to thejavax.tools.JavaCompilerAPI that the new plugin is using. -
<skipMultiThreadWarning>: deprecated as a consequence of<compilerReuseStrategy>deprecation.
The Maven compiler plugin has numerous default values, which sometime differ from the standard (JDK) default values.
For example, the default value of -source and -target options was hard-coded to "1.8" in Maven 3,
while the standard (JDK) default is the version of the JDK used for compiling the code.
The following parameters had their default value modified in the new plugin:
-
<source>and<target>: removed the default value and added a Javadoc saying "As of Java 9, the --release option is preferred." -
<release>: no default value. Therefor, the standard (JDK) default applies. -
<debugLevel>: omitting this parameter now means "JDK default debug info" instead of "all debug info".- A new
alllevel (Maven-specific) has been added for meaning "all debug info".
- A new
- The magic done by compiler and test MOJOs for trying to setup automatically some
--patch-moduleand--add-readsoption values has been removed.