-
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
Use <annotationProcessorPaths> in Maven examples for configuring an annotation processor #43329
Comments
Thanks for the suggestion. I think this should, at most, be addressed by Spring Boot with some documentation updates. I don't think we should set Some updates could be made to:
We can either duplicate the content, or we could consider adding a new section on annotation processor configuration to which the above sections could cross-link. Before we do anything, I'd like to double-check with the rest of the team if, given it's a general Maven with Java 23+ problem, it is something we want to cover in Boot's docs. |
Thanks to this change in the Maven compiler plugin, it looks like our best option here is to document that annotation processors be declared using |
Maybe Spring Boot could provide a default That might still require documentation to explain how to allow additional artifacts to execute their annotation processors, because a user specifying |
Thanks for the suggestion, but I don't think we should do that. Boot's annotation processors are currently an opt-in feature and I think that should remain the case. All that should change here is the recommended way to opt in when using Maven. |
I think besides the spring-boot documentation, start.spring.io would be an adequate place to generate a pom.xml with |
Configuring |
I've experimented a bit in one of my own Maven multi-module projects which uses Java 21, and in that scenario I found a downside to using I found that for that reason it's nicer to execute annotation processors via On a Java version that doesn't execute all detected annotation processors by default anyway, this might not be an issue, because then you don't need to set |
JDK-8321319 will disable the automatic execution of annotation processors that are present on the classpath in Java 23+, because of supply chain attack concerns.
This would for instance mean that just adding
spring-boot-configuration-processor
as a dependency won't do anything until the annotation processor in that artifact is explicitly allowed to run.I think Spring Boot will need to respond to this change in one way or another, either by documenting how users can deal with this (e.g.
maven-compiler-plugin
'sannotationProcessorPaths
, usingmaven-processor-plugin
, or dropping this protection again by setting-proc:full
while that's still available) or by configuringjavac
to execute Spring's (or all?) annotation processors automatically.The text was updated successfully, but these errors were encountered: