0

In my project, I don't want to use @EnableAutoConfiguration. My Application.java has @ComponentScan, @Configuration and @Import annotation.

I have added spring boot actuator dependency in my pom.xml. But, when I try to access http://<>/acutuator/health, I get 404. I believe I need to specify some config class as part of Import annotation. I would need help in figuring out what that config would be.

Assafs
  • 3,257
  • 4
  • 26
  • 39
Learner
  • 267
  • 2
  • 8

1 Answers1

0

@EnableAutoConfiguration makes Spring guess configuration based on the classpath, and that's what spring boot all about. If you find that specific auto-configuration classes that you do not want are being applied, you can use the exclude attribute of @EnableAutoConfiguration to disable them. For example:

@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
Luay Abdulraheem
  • 751
  • 3
  • 11
  • Thanks Luay. I have a long list to exclude but a small list to include. I would also like to keep control on what am I running. So, I would like to include selectively as done in answer of this: https://stackoverflow.com/questions/27230702/speed-up-spring-boot-startup-time. – Learner Oct 11 '18 at 03:20