Phase 1: Enable Spring Boot configuration metadata processor for existing @ConfigurationProperties modules (#15469)#15566
Conversation
Add spring-boot-configuration-processor to the modules that already use @ConfigurationProperties so configuration metadata can be generated automatically and maintained in sync with code.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Enables Spring Boot’s configuration metadata generation in several existing @ConfigurationProperties modules by wiring in the spring-boot-configuration-processor as an annotation processor (with versions governed by the Grails BOM).
Changes:
- Added
spring-boot-configuration-processortoannotationProcessorin five modules. - Applied
platform(project(':grails-bom'))to theannotationProcessorconfiguration to keep processor versions aligned.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| grails-web-url-mappings/build.gradle | Adds BOM-managed annotation processor dependency for configuration metadata generation |
| grails-views-markup/build.gradle | Adds BOM-managed annotation processor dependency for configuration metadata generation |
| grails-views-gson/build.gradle | Adds BOM-managed annotation processor dependency for configuration metadata generation |
| grails-databinding/build.gradle | Adds BOM-managed annotation processor dependency for configuration metadata generation |
| grails-cache/build.gradle | Adds BOM-managed annotation processor dependency for configuration metadata generation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| annotationProcessor platform(project(':grails-bom')) | ||
| annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor' |
There was a problem hiding this comment.
This same dependency block is duplicated across multiple modules in this PR. To reduce drift and make future updates easier, consider centralizing this in shared Gradle build logic (e.g., a convention plugin in buildSrc / included build, or a shared script applied by the relevant subprojects) so the processor + BOM wiring is defined in one place.
|
The suggestion is valid. The PR adds identical annotationProcessor dependencies to grails-cache, grails-databinding, grails-views-gson, grails-views-markup, and grails-web-url-mappings build.gradle files. Centralizing in shared Gradle logic would reduce duplication and ease future updates. |
|
Hi @vigneshsiva11 did you coordinate this change with @jamesfredley ? I think he already has some of this work in another PR. |
|
|
||
| dependencies { | ||
| implementation platform(project(':grails-bom')) | ||
| annotationProcessor platform(project(':grails-bom')) |
There was a problem hiding this comment.
Annotation processors are incompatible with incremental groovy compilation and can break the groovy compiler when used.
This pull request addresses part of the work for issue number 15469. It makes Spring Boots configuration metadata processor work in some modules that already use the ConfigurationProperties annotation.
Here are the modules that were updated:
These are the changes that were made:
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
So how does the process work?
When the code is compiled, the Spring Boot configuration processor automatically makes a file called
META-INF/spring-configuration-metadata.json
This keeps the configuration metadata in sync with the source code. It also reduces the need to manually keep metadata files up to date. The default values and property names come from the existing ConfigurationProperties classes.
The above is what was checked to make sure everything works:
Some things to note:
This pull request only does the part of the work for issue number 15469.
The configuration metadata for DSL will be done in later parts.