Access value application.properties of spingboot inside Liquibase mongodb xml changelog

Viewed 267

I need to set a base url in application.properties of springboot and need to insert record into mongodb in liquibase with that base url

Tried something like below

in application.properties

liquibase.parameters.url.info=http://www.google.com/

in insert Changelog.xml file

<ext:insertOne collectionName="test">
  <ext:document>
    {
      "url": ${url.info} // tried "${url.info}" as well
    }
  </ext:document>
</ext:insertOne>

Tried all options. Refereed link https://docs.liquibase.com/concepts/basic/changelog-property-substitution.html

Could anyone please help on this Using spring boot, Liquibase and mongodb

1 Answers

When using Spring Boot, the property should begin with spring.liquibase.parameters. In this case, the property should be named spring.liquibase.parameters.url.info

Related