记录一次error
本以为是 jdk编译版本和运行版本不匹配,idea里面是 1.9 ,本地安装是1.8 的 ,修改成一致的1.8还是 会报错;
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: 无效的目标发行版: 1.9 -> [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
苦思了一晚上, 想起来 可能是mvn
配置的问题, 好久没看mvn
的相关知识了;
如下图,在settings.xml文件里配置了 ==jdk为1.9 ==所以才会报 这个 maven 插件的错误;
改成 1.8就好了
<profile>
<id>jdk-1.8</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>