Declare annotation processors as compiler plugin config #14185
Merged
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.
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.