H2 database gets activated by default, although I have enabled oracle from Spring boot property files


1 weeks ago


9 time


We use hierarchically organised Spring boot property files in our application. For example,

Our application.properties will just contain a single line.

spring.profiles.include = logging, kafka, oracle, misc

Where all the values separated by comma here are other property files (namely application-logging.properties and so on) that it's referring to (We chose this for reusability in different environments)

And I have another properties file application-h2.properties that can be included while testing. So while I test, my application.properties will look like this.

spring.profiles.include = logging, kafka, h2, misc

The problem that's been bugging me here is that my application is always considering h2 database when it starts up, although I include oracle.

The only way I have to get Oracle enabled is that I have remove the h2 properties file, and also remove the h2 dependency from the gradle build file.

Appreciate your help!

0 answers