Androidas
Androidas

Reputation: 169

Spring flyway configuration: cannot find placeholders when running sql

I am trying to run gradlew flywayMigrate, and the application chrashes when running a recurring migration with the error

Caused by: org.flywaydb.core.api.FlywayException: No value provided for placeholder expressions: ${dbLinkHost}, ${dbLinkPassword}, ${dbLinkSid}, ${dbLinkUser}. Check your configuration!

The variables are configured like this in application.yml:

flyway:
  placeholders:
    dbLinkHost: ...
    dbLinkSid: ...
    dbLinkUser: ...
    dbLinkPassword: ...

And I try to access them like this in the sql file:

'${dbLinkHost}'

Does anyone know why the declarations in application.yml don`t seem to be accessible here?

Upvotes: 1

Views: 1881

Answers (1)

Daniel Trebbien
Daniel Trebbien

Reputation: 39228

As a result of Spring Boot Issue #9896 - Move Flyway configuration properties to spring.flyway and commit f9e3163, starting with v2.0.0.M4, Flyway configuration properties in your application properties start with spring.flyway. To configure Flyway placeholders, for example:

spring:
  flyway:
    placeholders:
      dbLinkHost: ...
      dbLinkSid: ...
      dbLinkUser: ...
      dbLinkPassword: ...

In Spring Boot versions before v2.0.0.M4 such as the recently-released v1.5.14.RELEASE, Flyway configuration properties start with flyway.

Upvotes: 1

Related Questions