jdaugherty commented on code in PR #15934:
URL: https://github.com/apache/grails-core/pull/15934#discussion_r3547113928


##########
grails-core/src/main/groovy/grails/plugins/Plugin.groovy:
##########
@@ -105,10 +106,29 @@ abstract class Plugin implements 
GrailsApplicationLifeCycle, GrailsApplicationAw
      * Sub classes should override to provide implementations
      *
      * @return A closure that defines beans to be executed by Spring
+     * @deprecated since 8.0 in favour of {@link #beanRegistrar()}. The bean 
builder DSL continues
+     * to work, but {@link #beanRegistrar()} is the modern, Spring-native 
replacement.
      */
+    @Deprecated(since = '8.0')
     @Override
     Closure doWithSpring() { null }
 
+    /**
+     * Sub classes should override to register beans with the Spring Framework
+     * {@link org.springframework.beans.factory.BeanRegistry} using a
+     * {@link org.springframework.beans.factory.BeanRegistrar}. This is the 
modern, Spring-native
+     * replacement for the {@link #doWithSpring()} bean builder DSL.
+     *
+     * <p>The returned registrar is applied before Spring Boot 
auto-configuration is processed, so
+     * beans registered here take precedence over Boot's {@code 
@ConditionalOnMissingBean} defaults.</p>
+     *
+     * @return A {@link org.springframework.beans.factory.BeanRegistrar} that 
registers beans,
+     * or {@code null} if none (the default)
+     * @since 8.0
+     */
+    @Override
+    BeanRegistrar beanRegistrar() { null }

Review Comment:
   I'm happy with this compromise.  Hopefully others are too.



-- 
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