fix: build failure for lombok in JDK23#767
Conversation
fix build failure: ``` [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project apm-agent-core: Compilation failure: Compilation failure: [ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[51,31] cannot find symbol [ERROR] symbol: method getTraceId() ```
|
Which env does you face this? The project is built successfully in local and CI env(s). |
It happens in two situations:
JDK versionMaven version |
|
We only support Java 11/17/21, and consider that you just bumped up lombok, could you recheck whether this is a JDK23-specific issue? And notice, JDK23 is not a TLS version. Do you have some specific reasons to use that? |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a build failure caused by missing getter methods in Lombok-annotated classes by configuring the Maven compiler plugin to properly process Lombok annotations during compilation.
- Adds Lombok annotation processor configuration to the Maven compiler plugin
- Ensures getter methods are generated during compilation for classes using Lombok annotations
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| <path> | ||
| <groupId>org.projectlombok</groupId> | ||
| <artifactId>lombok</artifactId> | ||
| <version>${lombok.version}</version> |
There was a problem hiding this comment.
The Lombok version is referenced using a property ${lombok.version} but this property may not be defined in the POM. Consider verifying that this property is declared in the properties section or use an explicit version number.
There was a problem hiding this comment.
Yes. The property ${lombok.version} is defined in line 86 in the ROOT pom.xml
<lombok.version>1.18.30</lombok.version>
kezhenxu94
left a comment
There was a problem hiding this comment.
This should be good regardless which JDK version
fix build failure: