vigneshsiva11 opened a new pull request, #15570:
URL: https://github.com/apache/grails-core/pull/15570

   ## Problem
   Phase 1 (PR #15566) scoped Spring Boot configuration metadata generation to 
`grails-databinding` because applying annotation processors broadly to Groovy 
modules is incompatible with incremental Groovy compilation (see #15211).
   
   For Phase 2, processor wiring still needed to be centralized so we avoid 
copy/paste dependency declarations and can safely enable it only where intended.
   
   ## Approach
   This PR moves processor wiring into shared build logic and introduces 
explicit module opt-in:
   
   - Added centralized wiring in `CompilePlugin`:
     - `configureAnnotationProcessors(project)` is invoked from compile plugin 
setup.
     - Adds:
       - `annotationProcessor platform(project(':grails-bom'))`
       - `annotationProcessor 
'org.springframework.boot:spring-boot-configuration-processor'`
     - Uses module-local opt-in flag: `ext.enableAnnotationProcessor = true`
   - Enabled opt-in only in `grails-databinding`.
   - Removed inline processor declarations from Groovy-heavy modules where they 
are unsafe:
     - `grails-cache`
     - `grails-views-gson`
     - `grails-views-markup`
   
   ## Why this is safe
   - Default behavior is unchanged for all modules unless they explicitly opt 
in.
   - Groovy modules remain processor-free unless explicitly enabled.
   - Keeps the Phase 1 safety direction while reducing future duplication.
   
   ## Validation Evidence
   Executed on Java 17:
   
   1. Dependency checks
   - `:grails-databinding:dependencies --configuration annotationProcessor`
     - shows `spring-boot-configuration-processor` and BOM platform dependency
   - `:grails-cache:dependencies --configuration annotationProcessor`
     - shows `No dependencies`
   - `:grails-views-gson:dependencies --configuration annotationProcessor`
     - shows `No dependencies`
   - `:grails-views-markup:dependencies --configuration annotationProcessor`
     - shows `No dependencies`
   
   2. Compile checks
   - `:grails-databinding:compileGroovy`
   - `:grails-cache:compileGroovy`
   - `:grails-views-gson:compileGroovy`
   - `:grails-views-markup:compileGroovy`
   
   All completed successfully.
   
   3. Metadata artifact generated
   - 
`grails-databinding/build/classes/groovy/main/META-INF/spring-configuration-metadata.json`
   
   ## Related
   - Issue: #15469
   - Prior phase: PR #15566
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to