Skip to content

HIVE-28885: Disable unnecessary annotation processing #5751

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

Closed
wants to merge 1 commit into from

Conversation

zabetak
Copy link
Member

@zabetak zabetak commented Apr 7, 2025

What changes were proposed in this pull request?

  1. Disable annotation processors from all modules that do not need them.
  2. Decouple immutables processor from errorprone processor and move immutables processor in iceberg-catalog module since it is only user there.

Why are the changes needed?

Except iceberg, all the other modules do not need annotation processors. However, the log4j-core dependency contains an annotation processor and this has impact on the build leading to maven WARNING messages and the deactivation of compile avoidance.

[WARNING] The following annotation processors were found on the classpath:
[org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor], provided by /home/someuser/.m2/repository/org/apache/logging/log4j/log4j-core/2.24.3/log4j-core-2.24.3.jar
Compile avoidance has been deactivated.
Please use the maven-compiler-plugin version 3.5 or above and use the <annotationProcessorPaths> configuration element to declare the processors instead.
If you did not intend to use the processors above (e.g. they were leaked by a dependency), you can use the <proc>none</proc> option to disable annotation processing.

For more information see https://gradle.com/help/maven-extension-compile-avoidance.

Apart from compile avoidance the use of annotation processing can have other side effects during the build and it can even lead to cryptic compilation failures.

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

  1. Checked that build passes with itests and errorProne profile activated.
mvn clean install -DskipTests -Pitests
mvn clean install -DskipTests -Pitests,errorProne
  1. Verified that annotation processor warnings are gone
  2. Introduced some errorProne bugs (e.g., use toString on array) in iceberg catalog module and confirmed that build fails when errorProne profile is active.
long[] someArray = new long[1];
someArray.toString();

1. Disable annotation processors from all modules that do not need them.
2. Decouple immutables processor from errorprone processor and move immutables processor in iceberg-catalog module since it is only user there.

Except iceberg, all the other modules do not need annotation processors.
However, the log4j-core dependency contains an annotation processor and this has impact on the build leading to maven WARNING messages and the deactivation of compile avoidance.

```
[WARNING] The following annotation processors were found on the classpath:
[org.apache.logging.log4j.core.config.plugins.processor.PluginProcessor], provided by /home/someuser/.m2/repository/org/apache/logging/log4j/log4j-core/2.24.3/log4j-core-2.24.3.jar
Compile avoidance has been deactivated.
Please use the maven-compiler-plugin version 3.5 or above and use the <annotationProcessorPaths> configuration element to declare the processors instead.
If you did not intend to use the processors above (e.g. they were leaked by a dependency), you can use the <proc>none</proc> option to disable annotation processing.

For more information see https://gradle.com/help/maven-extension-compile-avoidance.
```

Apart from compile avoidance the use of annotation processing can have other side effects during the build and it can even lead to cryptic compilation failures.
Copy link

sonarqubecloud bot commented Apr 9, 2025

Copy link

github-actions bot commented Jun 9, 2025

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Feel free to reach out on the [email protected] list if the patch is in need of reviews.

@github-actions github-actions bot added the stale label Jun 9, 2025
@github-actions github-actions bot closed this Jun 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants