-
Notifications
You must be signed in to change notification settings - Fork 181
[MCOMPILER-1006] Fix <proc>only</proc> not triggering annotation processors #1017
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
please fix formatting |
|
fixed. |
| * Base class of Mojos compiling Java source code. | ||
| * This plugin uses the {@link JavaCompiler} interface from JDK 6+. | ||
| * Each instance shall be used only once, then discarded. | ||
| * Base class of Mojos compiling Java source code. This plugin uses the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this unnecesary changes to javadocs here and bellow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add that the previous formatting was intentional. We try to change lines after a natural separator such as a dot, or a comma if the line is too long. This is because in commits, changes are shown on a line-by-line basis. When sentences are on their own line, then if (for example) the sentence "Base class of Mojos…" is changed, it is easier to see that the "This plugin uses…" sentence is not modified.
|
avoid changing javadocs comments if not needed. |
|
Also add test that will show problem described in #1006 |
Added a fix to ensure that annotation processors only run when specified.
|
I have restored the previous code and only changed what i want to, means where the Maven Compiler Plugin did not execute annotation processors properly when only was set. The main thing is i actually formatted the code in the code editor not used the formatting command. making sure that it is now ready for review. |
Summary
This PR fixes issue #1006, where the Maven Compiler Plugin did not execute annotation processors properly when
<proc>only</proc>was set. Previously, the plugin exited early with the message "Nothing to compile - all classes are up to date," which stopped annotation processors from running.Changes
execute()method to make sure that when<proc>only</proc>is set, the compiler runs even if no Java source files have changed.Rationale
Annotation processors like Log4j’s
PluginProcessormust run independently of source compilation. This change makes the plugin behave likejavac -proc:onlyand clears up confusion from misleading log messages.Impact
<proc>only</proc>.Verification
target/generated-sources/annotations.mvn -Prun-its verify.Please review and let me know if you want me to add an integration test for this specific use case.