How to disable Spring Boot auto configuration.I want to disable the data source auto configuration.
Asked
Active
Viewed 1,178 times
1 Answers
2
Try this two way:
Properties configuration
spring:
profiles: app-profile
autoconfigure:
exclude:
- org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
- org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
Class level configuration
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
public class SpringBootApp {
public static void main(String[] args) {
SpringApplication.run(SpringBootApp.class, args);
}
Reference:

Imranmadbar
- 4,681
- 3
- 17
- 30
-
If you could also include a link to general guide that would be great. +1 nevertheless – TheCoolDrop Dec 20 '21 at 07:16