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


##########
grails-core/src/main/groovy/grails/boot/config/GrailsEarlyPluginRegistrationPostProcessor.java:
##########
@@ -120,6 +127,20 @@ public void 
postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t
             return;
         }
 
+        // Two things make a context a Grails application: GrailsApp launched 
it, which it records by
+        // stashing the sources it was given, or one of its sources is a 
Grails application class.
+        // This initializer is registered for every Spring Boot application 
with grails-core on its
+        // class path, and the plugin lifecycle is not something the rest of 
them asked for: it would
+        // contribute a GrailsApplication, a plugin manager and the beans of 
every plugin found, over
+        // the top of whatever the libraries they did ask for auto-configure 
for themselves.
+        boolean launchedByGrails =
+                
applicationContext.getBeanFactory().getSingleton(APPLICATION_SOURCE_CLASSES_BEAN_NAME)
 != null;
+        Class<?>[] applicationSources = 
resolveApplicationSourceClasses(registry);
+        if (!launchedByGrails && 
!containsApplicationClass(applicationSources)) {

Review Comment:
   @matrei  Are you really ok with the behavior that Application class is now 
required for SpringBootTest usage? 



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