0

Currently I have a SBA (Spring Boot App 1.5.10.RELEASE) which has two configuration property files like application-default.properties and application-oracle.properties. Furthermore those files are located in src/main/resources they end up in the resulting jar file in BOOT-INF/classes/ The applilcation-oracle.properties contains something like this:

#
# Turn off liquibase initialization.
spring.liquibase.enabled=false

# Oracle settings
spring.datasource.url=jdbc:oracle:thin:@localhost:1521/xe
spring.datasource.username=..
spring.datasource.password=...
spring.datasource.driver-class-name=...
#
# Hibernate
spring.jpa.properties.hibernate.dialect=....
#
spring.jpa.properties.hibernate.show_sql=false
spring.jpa.properties.hibernate.use_sql_comments=true
spring.jpa.properties.hibernate.format_sql=true

The application-default.properties looks similar except for spring.liquibase.enabled which is not contained and contains a connection to a local PostgreSQL instead of Oracle.

I have a dependency to liquibase in my pom file.

So now I would like to start my SBA simply via:

java -jar x.jar --spring.profiles.active=default ..

which prints out as expected that liquibase initialization is running.. afterwards I would like to start it like this:

java -jar x.jar --spring.profiles.active=oracle ..

and expected that the inialization via liquibase will not happen based on the given spring.liquibase.enabled=false but in contradiction to my expectation it will start the initialization via liquibase.

So the question is: Did I oversight something ?

khmarbaise
  • 92,914
  • 28
  • 189
  • 235

1 Answers1

0

Default properties for spring boot 1.5.10 is:

LIQUIBASE (LiquibaseProperties)

liquibase.change-log=classpath:/db/changelog/db.changelog-master.yaml # Change log configuration path.
liquibase.check-change-log-location=true # Check the change log location exists.
liquibase.contexts= # Comma-separated list of runtime contexts to use.
liquibase.default-schema= # Default database schema.
liquibase.drop-first=false # Drop the database schema first.
liquibase.enabled=true # Enable liquibase support.
liquibase.labels= # Comma-separated list of runtime labels to use.
liquibase.parameters.*= # Change log parameters.
liquibase.password= # Login password of the database to migrate.
liquibase.rollback-file= # File to which rollback SQL will be written when an update is performed.
liquibase.url= # JDBC url of the database to migrate. If not set, the primary configured data source is used.
liquibase.user= # Login user of the database to migrate.
Pär Nilsson
  • 2,259
  • 15
  • 19