tips:
The /META-INF/spring.factories file is deprecated in Spring Boot 2.7, and support for /META-INF/spring.factories will be removed in Spring Boot 3.
The new way of writing is to create a new file:
/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
The content can be directly placed in the configuration class (note that there is a spring directory),
such as this: com.github.cherryNo1.ActuatorConfig
If the springboot version is higher than 2.7, switch to the new writing method and try
Spring Boot 3. Please use /META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
it to directly write what needs to be added to the container Beans
use this class to add scan packages
package com.github.cherryNo1;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
/**
* @author maqingbo
*/
@Configuration
@ComponentScan(basePackages = {
"com.github.cherryNo1"})
public class ActuatorConfig {
}
Below Spring Boot 3 please use/META-INF/spring.factories