I want to use google-java-format plugin in my code.For that reason I added some exports configuration to my pom inside the maven compiler plugin and after run clean install process I got error.I try this command outside of the idea and using maven command via over commandline.
exporting a package from system module jdk.compiler is not allowed with --release
Regards
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
<configuration>
<!--<release>${maven.compiler.target}</release>-->
<compilerArgs>
<arg> --add-opens=java.base/java.lang=ALL-UNNAMED</arg>
<arg>--add-opens=java.base/java.util=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
<arg>--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
</plugin>
I hit the same issue with spring boot 3.1.x and java 17. The compiler argument "--add-exports" no longer working with spring boot 3.1.x.
Spring boot up to version 3.0.9 works ok with that compiler argument, but 3.1.x versions all fail (3.1.0, 3.1.1, 3.1.2).