I'm woundering if it's possible to disable the intialization of JPA Stack competelly.
I some situation my application is executed in enviroment where database is not accessible. Application can survive this on application level. But technically i get some exception on intialization of Data Source.
Yes, you could use profiles for that: one with JPA and another without it. To turn off DataSource/JPA autoconfiguration you need to add spring.autoconfigure.excludes
property (with fully-qualified class names) to profile-specific application.properties
.
What classes to exclude? I suggest to start from DataSourceAutoConfiguration
and if it's not enough try to disable other database-related autoconfiguration classes.
Note that spring.autoconfigure.excludes
is a new feature that is avaiable since Spring Boot 1.3.0.M3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With