-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Disable annotation processing in AOT compilation step #38711
Comments
We may not need to do anything for Gradle builds. Gradle should ignore annotation processors on the compile classpath and only use those declared in the |
@snicoll Do you have a sample project available that produces the warning? |
Nope, sorry. I had the warning in framework tests using Regardless, the issue is not really about the warning, but about the fact that, if I am not mistaken, AP (at least with Maven) are invoked by the AOT compilation run and shouldn't. |
This comment was marked as outdated.
This comment was marked as outdated.
After some more discussion with @snicoll things have become a bit clearer. We're not looking to disable annotation processing of user code, rather we'd want to make a change to this part of |
We don't have complete control over the code that's generated. It's possible that someone has written a custom code generation contribution that relies on annotation processing. If we made this change, it would break them so I wonder if we'd also need to add a way to reverse it. |
By default, the compiler attempts to discover annotation processors from the classpath. This can have side effect on code that is generated ahead of time.
Adding
-proc:none
in the Maven and Gradle integration could be on way of making sure these don't run.See also spring-projects/spring-framework#30824 which now annotates every generated class which should trigger a warning if AP is active and no processor claimed it (which is likely to happen).
The text was updated successfully, but these errors were encountered: