默认情况下,Spring Boot 会自动从 classpath:/application.properties
我想知道这个自动配置源代码在哪里。我想从我的应用程序中排除。IE:@EnableAutoConfiguration(exclude=XXXXAutoconfiguration.class)
原因是:因为我无法使用外部属性覆盖默认的 application.properties @PropertySource
@SpringBootApplication
@ComponentScan(basePackages = {"com.test.green.ws"})
@PropertySource(value = {"classpath:/application.properties", "file:/opt/green-ws/application.properties"})
public class GreenWSApplication {
public static void main(String[] args) {
SpringApplication.run(GreenWSApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)