Annotation Interface EnableBroadleafAdminAutoConfiguration


Bootstraps Broadleaf admin configuration XML for both servlet and non-servlet. As a result, this annotation should only be placed on an @Configuration class within a servlet. If there are no custom ServletContainerInitializers with a servlet-specific ApplicationContext (like in a non-servlet spring boot application) then this must be placed on an inner static class within the @SpringBootApplication class. Example:

 @SpringBootApplication
 public class MyApplication extends SpringBootServletInitializer {

     @Configuration
     @EnableBroadleafAdminAutoConfiguration
     public static class BroadleafConfiguration { }

     public static void main(String[] args) {
         SpringApplication.run(ApiApplication.class, args);
     }

     @Override
     protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
         return application.sources(ApiApplication.class);
     }
 }

 

Since this annotation is a meta-annotation for @Import, this can be placed on a @Configuration class that contains an @Import annotation, but this @Import's beans will take precedence over any additional @Import applied.

This import utilizes the FrameworkXmlBeanDefinitionReader so that framework XML bean definitions will not overwrite beans defined in a project.

Since:
5.2
Author:
Philip Baggett (pbaggett), Phillip Verheyden (phillipuniverse), Nick Crum (ncrum)
See Also: