Closed belingueres closed 4 months ago
Hi @belingueres ,
the getting started docs contain a minimal configuration, but htere is also a grey box below pointing out that there is security in the servlet sample, which imports the security config in the Application class: @Import({ SecurityPermitAllConfig.class, SecuritySecureConfig.class, NotifierConfig.class })
.
But we agree that these things will be much simpler with @SpringBootApplication, we will try to update the samples and the docs.
That seems to be the case: adding the @SpringBootApplication seems to auto-scan for the @Configuration classes. Otherwise we have to explicitly @Import each one of them.
The problem is that autoscanning finds too many configurations as the samples are in the same package as the admin itself. This will be changed here: #3297
Spring Boot Admin Server information
Version: 3.2.3
Spring Boot version: 3.2.3
Configured Security: https://docs.spring-boot-admin.com/current/security.html the exact example configuration.
Webflux or Servlet application: do not apply
Client information
Spring Boot versions: 3.2.3
Used discovery mechanism: SBA client
Webflux or Servlet application: do not apply
Description
I had a hard time configuring Security as in the documentation example.
In the https://docs.spring-boot-admin.com/current/getting-started.html:
The spring boot app main class is defined as:
but in order for the app to recognize the security config I needed to change @Configuration for @SpringBootApplication: