Skip to content

Phase 1: Enable Spring Boot configuration metadata processor for existing @ConfigurationProperties modules (#15469)#15566

Open
vigneshsiva11 wants to merge 1 commit intoapache:7.0.xfrom
vigneshsiva11:feat/15469-config-metadata-processor-phase1
Open

Phase 1: Enable Spring Boot configuration metadata processor for existing @ConfigurationProperties modules (#15469)#15566
vigneshsiva11 wants to merge 1 commit intoapache:7.0.xfrom
vigneshsiva11:feat/15469-config-metadata-processor-phase1

Conversation

@vigneshsiva11
Copy link
Copy Markdown

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:

  • grails-databinding
  • grails-web-url-mappings
  • grails-cache
  • grails-views-gson
  • grails-views-markup

These are the changes that were made:

  • A new dependency was added:

annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

  • The Grails BOM was applied to the annotation processor configuration. This means the dependency will be resolved correctly when the project is built.

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:

  • Java 17 was. Set up in the development container
  • The Gradle compilation was completed successfully for the updated modules
  • The generated metadata was checked in the build output for an example like the grails-databinding module

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.

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.
Copilot AI review requested due to automatic review settings April 9, 2026 16:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-processor to annotationProcessor in five modules.
  • Applied platform(project(':grails-bom')) to the annotationProcessor configuration 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.

Comment on lines +37 to +38
annotationProcessor platform(project(':grails-bom'))
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@bito-code-review
Copy link
Copy Markdown

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.

@jdaugherty
Copy link
Copy Markdown
Contributor

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'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation processors are incompatible with incremental groovy compilation and can break the groovy compiler when used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants