今天想將項目的jdk版本從8升級到11,maven編譯時遇到了下面的問題
錯誤日志
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project myadmin: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [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
解決方法
通過網上查資料,原因是lombok的版本太低造成的,我使用的是1.16.4,不支持jdk10及以上,換成1.18.4就好了。
lombok可以查看lombok各個版本的更新情況。