Skip to content

Conversation

@Manas-Dikshit
Copy link

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

  • Updated the execute() method to make sure that when <proc>only</proc> is set, the compiler runs even if no Java source files have changed.
  • Added a clear log message to show that annotation processing is taking place without regular compilation.

Rationale

Annotation processors like Log4j’s PluginProcessor must run independently of source compilation. This change makes the plugin behave like javac -proc:only and clears up confusion from misleading log messages.

Impact

  • No change in behavior for standard compilation.
  • Improves correctness and clarity when using <proc>only</proc>.
  • Backward compatible and safe for existing builds.

Verification

  • Verified locally with a project using Log4j’s annotation processor.
  • Confirmed the generated sources appear as expected in target/generated-sources/annotations.
  • All existing integration tests pass with mvn -Prun-its verify.

Please review and let me know if you want me to add an integration test for this specific use case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant