Home:ALL Converter>How to make Lombok and AspectJ work together?

How to make Lombok and AspectJ work together?

Ask Time:2014-09-18T11:25:20         Author:Eric B.

Json Formatter

I just finished posting this issue on SO about Lombok not generating my getters/setters. It turns out that it is conflicting with AspectJ. If I disable AspectJ, then the getters/setters are appropriately generated.

My guess is that the ajc compiler is not able to recognize lombok.

Are Lombok and AspectJ mutually exclusive? Do both technologies work together?

Author:Eric B.,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/25903686/how-to-make-lombok-and-aspectj-work-together
kriegaex :

The current answer according to AspectJ maintainer Andy Clement is that there are problems due to ECJ (Eclipse Compiler for Java) packages being included and renamed in the AspectJ compiler infrastructure. \n\nFor more information there is ongoing discussion between Eric B. and A. Clement on the AspectJ users mailing list:\n\n\nDiscussion thread\nDiscussion thread continued\n\n\nMaybe we can close the issue here with this answer and report back when the problem is solved.",
2014-10-02T09:22:08
shearn89 :

In 2022 - there's an answer to this on the AWS docs for the Lambda Powertools FAQ: https://awslabs.github.io/aws-lambda-powertools-java/FAQs/\nTo enable in-place weaving feature you need to use following aspectj-maven-plugin configuration:\n<configuration>\n <forceAjcCompile>true</forceAjcCompile> \n <sources/>\n <weaveDirectories>\n <weaveDirectory>${project.build.directory}/classes</weaveDirectory>\n </weaveDirectories>\n ...\n <aspectLibraries>\n <aspectLibrary>\n <groupId>software.amazon.lambda</groupId>\n <artifactId>powertools-logging</artifactId>\n </aspectLibrary>\n </aspectLibraries>\n</configuration>\n",
2022-04-08T13:10:32
yy