Trying to migrate Maven from Java 9 to Java 10 produces errors in the pom.xml
,the maven-compiler-plugin
doesn't work :
Java 9 Configuration (works more than great):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.9</source>
<target>1.9</target>
<release>9</release>
<executable>javac9</executable>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Java 10 Configuration ( fails ) based on this stackoverflow question:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>10</source>
<target>10</target>
<release>10</release>
<executable>javac10</executable>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.1.1</version> <!-- Use newer version of ASM -->
</dependency>
</dependencies>
</plugin>
Error on mvn clean package
:
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ XR3Player ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 164 source files to D:\GitHub\XR3Player\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.915 s
[INFO] Finished at: 2018-04-24T18:12:17+03:00
[INFO] Final Memory: 14M/48M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project XR3Player: Fatal error compiling: release version 10 not supported -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException