The company needs to upgrade the original spring cloud project from jdk8 to jdk11 for new projects recently, but errors are always reported when packaging with Maven:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project cloud-api-commons: Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTag
s
I checked the information on the Internet and basically said
(1) Because the version does not correspond, change the version
(2) Add a dependency
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
<scope>provided</scope>
</dependency>
(3) Eclipse, because the JDK is configured as JRE
None of the above methods can solve my problem, so I executed MVN install
with the command
See the alarm information of Lombok
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
With a try mentality, comment out the lombom code in the code (the dependency is still there), repackage and solve the problem.
Summary: I don’t quite understand the principle, but there are risks in using Lombok upgrade. Use it with caution.
Similar Posts:
- Maven does not have a servlet (an error is reported after the servlet is created)
- Springboot startup error start bean ‘eurekaautoserviceregistration’ NullPointerException
- Springboot always reports an error when importing JSP dependencies
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- Error during artifact deployment. See server log f
- [Solved] Jsonobject has no from object, idea has no Maven dependency, jsonobject Maven dependency package
- java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config [How to Solve]
- Unregistering JMX-exposed beans on shutdown Solution
- The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
- [Solved] Maven install failed (package com.google.gson does not exist)