I am trying to pass a parameter from my update command as well as the liquibase properties file to my changeset. For some reason, it does not recognise the placeholder as a para
I have a requirement like calling a .bat file with parameters from liquibase upgrade scripts. Also also this should run only one time like change set.
Thanks, Jagadeesh
Rather than using this in your changelog:
<changeSet author="tobi" id="preMigration" runAlways="true">
<executeCommand executable="C:\myBatFile.bat">
<arg value="${liquibase.properties.Dparamname}"/>
<arg value="${liquibase.properties.url}"/>
</executeCommand>
</changeSet>
it should look more like this:
<changeSet author="tobi" id="preMigration" runAlways="true">
<executeCommand executable="C:\myBatFile.bat">
<arg value="${paramname}"/>
<arg value="${url}"/>
</executeCommand>
</changeSet>
The -D
on the command line is the standard java mechanism for setting system properties, but when accessing them you just use the property name. I am fairly certain that you don't need to use the liquibase.properties
prefix either.