Add weaveOnly parameter to support Lombok integration#246
Open
youngledo wants to merge 2 commits into
Open
Conversation
- Add weaveOnly parameter to skip source compilation - When weaveOnly is true, only weave class files - This fixes compilation issues with Lombok in multi-module projects - Lombok annotation processing can complete before AspectJ weaving
slachiewicz
requested changes
Dec 7, 2025
slachiewicz
left a comment
Member
There was a problem hiding this comment.
please add unit/integration tests
…aveOnlyMojoTest) to validate weaveOnly parameter functionality for Lombok integration in multi-module projects.
Author
Added. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Correct fix for the "#231" issue.
Previously, @slachiewicz had done a "fix" using Copilot(#239). The author was skeptical about that fix and deleted the branch, and based on my testing(multi-module-aspect), the problem indeed still exists.
Here are the fixes I made after further analysis and testing.
Problem
When using AspectJ Maven Plugin with Lombok in multi-module projects, compilation fails because AspectJ tries to compile source files before Lombok annotation processing completes.
Solution
This PR adds a new
weaveOnlyparameter to the plugin. When set totrue, the plugin will:Usage Example
Testing
Tested with a multi-module project using both Lombok and AspectJ. Build succeeds when:
Related Issues
This addresses the common issue of integrating Lombok with AspectJ in Maven builds.