[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building log4j2-demo 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ log4j2-demo --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 2 resources [INFO] [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ log4j2-demo --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 5 source files to /Users/yibo/IdeaProjects/xianlai/log4j2demo/target/classes Processing annotations Annotations processed WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by lombok.javac.apt.LombokProcessor to field com.sun.tools.javac.processing.JavacProcessingEnvironment.discoveredProcs WARNING: Please consider reporting this to the maintainers of lombok.javac.apt.LombokProcessor WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.148 s [INFO] Finished at: 2018-05-06T09:52:10+08:00 [INFO] Final Memory: 12M/50M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project log4j2-demo: 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
关于这个问题的原因呢,解释如下 the javac version “10-ea” doesn’t match VERSION_PARSER in Javac.java Similar, the “JDK10” enum name in Sources doesn’t match the SOURCE_PARSER pattern. Meaning it falls back to version 6, so it ends up looking for TypeTags instead of TypeTag.