在构建从java 1.8升级到java 11.0.11的maven项目时。出现如下错误
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project XXX.XXX.XXX: Fatal error compiling: target level should be comprised in between '1.1' and '1.8' (or '5', '5.0', ..., '8' or '8.0') or cldc1.1: 11.0.11
配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
你必须使用插件的配置区…
<project>
[...]
<build>
[...]
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
</plugins>
[...]
</build>
[...]
</project>