I just found out, that IntelliJ behaves very peculiarly when configuring the maven-compiler-plugin with <release>
only:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>14</release>
</configuration>
</plugin>
As a result after reloading the Maven project, in the 'Java Compiler' preferences, it displays target bytecode level 8
instead of the expected 14
. I guess it was inferred because the modules didn't use any Java 14 features, yet.
see preferences screenshot: https://i.stack.imgur.com/gqpKV.jpg
In comparison, when adding <source>
and <target>
the IDE configures its own configuration, correctly.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>14</source>
<target>14</target>
</configuration>
</plugin>
see preferences screenshot: https://i.stack.imgur.com/gqpKV.jpg
As far as I understand it, the javac --release
option is slightly more reliable than just defining -source
and -target
because it additionally sets the -bootclasspath
option to the correct level (double-checked with this SO post). So it seems to me that relying on this option exclusively is a better practice.
Is there another configuration step that I would have to execute in order to make IntelliJ set up the preferences, correctly, without declaring the older parameters?