@Target(value=TYPE) @Retention(value=RUNTIME) @Documented @Import(value={EnableBroadleafRootAutoConfiguration.BroadleafRootAutoConfiguration.class,EnableBroadleafAdminRootAutoConfiguration.BroadleafAdminRootAutoConfiguration.class,EnableBroadleafAdminRootAutoConfiguration.BroadleafAdminRootAutoConfigurationOverrides.class}) public @interface EnableBroadleafAdminRootAutoConfiguration
Bootstraps the Broadleaf root admin configuration XML for only non-servlet beans. This can be placed on any @Configuration
class (except ones with additional @ImportResource) to make the root Broadleaf beans apart of the ApplicationContext
.
If you are using Spring boot, this must be placed on an inner static class within the @SpringBootApplication class. Example:
@SpringBootApplication public class MyApplication extends SpringBootServletInitializer { @Configuration @EnableBroadleafAdminRootAutoConfiguration 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.
Since this does not include any of the servlet-specific Broadleaf beans, this is generally only used when you are not running in a
servlet environment at all or there is a parent-child relationship between a root ApplicationContext
and you want to
configure multiple servlets that share much of the same beans. In general, rather than create multiple servlets with shared
configuration you should instead create separate deployments and utilize EnableBroadleafAdminAutoConfiguration
in a single place.
This import utilizes the FrameworkXmlBeanDefinitionReader
so that framework XML bean definitions will not
overwrite beans defined in a project.
EnableBroadleafAdminAutoConfiguration
,
EnableBroadleafAdminServletAutoConfiguration
,
EnableBroadleafAutoConfiguration
Copyright © 2022. All rights reserved.