Skip to content
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

Declare annotation processors as compiler plugin config #14185

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

gortiz
Copy link
Contributor

@gortiz gortiz commented Oct 8, 2024

This PR declares Java annotation processors as recommended since Maven 3.5 (see https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html#annotationProcessorPaths).

This change is pretty simple, we just need to declare the dependencies in a specific section in the plugin config.

Although the older way to use this annotation processors in Maven still works, Maven shows a warning when that mode is used.

Context

Java annotation processors are a way to generate code at compile time in Java. This can be used by tools like Google Auto project (https://github.com/google/auto/tree/main) or Immutables.

In Pinot we use Google AutoServices to generate Java Service Provider Interfaces (see https://www.baeldung.com/java-spi). For example this is used on IndexType. We have other open PRs at this time that use annotation processors to generate Calcite Rule config (see #13943).

Originally these annotation processors were just drop into the compilation classpath, but in the latest years the javac has a explicit way to define these processors. Since version 3.5, Maven supports this new javac argument, but in order to use it the dependencies must be declared explicitly.

@gortiz gortiz mentioned this pull request Oct 8, 2024
2 tasks
@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.84%. Comparing base (59551e4) to head (8ed853b).
Report is 1150 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #14185      +/-   ##
============================================
+ Coverage     61.75%   63.84%   +2.08%     
- Complexity      207     1535    +1328     
============================================
  Files          2436     2621     +185     
  Lines        133233   144087   +10854     
  Branches      20636    22036    +1400     
============================================
+ Hits          82274    91986    +9712     
- Misses        44911    45323     +412     
- Partials       6048     6778     +730     
Flag Coverage Δ
custom-integration1 100.00% <ø> (+99.99%) ⬆️
integration 100.00% <ø> (+99.99%) ⬆️
integration1 100.00% <ø> (+99.99%) ⬆️
integration2 0.00% <ø> (ø)
java-11 63.81% <ø> (+2.10%) ⬆️
java-21 63.72% <ø> (+2.09%) ⬆️
skip-bytebuffers-false 63.83% <ø> (+2.08%) ⬆️
skip-bytebuffers-true 63.69% <ø> (+35.96%) ⬆️
temurin 63.84% <ø> (+2.08%) ⬆️
unittests 63.83% <ø> (+2.08%) ⬆️
unittests1 55.51% <ø> (+8.62%) ⬆️
unittests2 34.37% <ø> (+6.64%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gortiz gortiz merged commit 58f36a1 into apache:master Oct 9, 2024
23 checks passed
@gortiz gortiz deleted the use-compiler-annotator-processor branch October 9, 2024 12:42
@Jackie-Jiang Jackie-Jiang mentioned this pull request Oct 9, 2024
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.

3 participants