Although I’m an advanced Liquibase user, I’m stumped when it comes to using custom properties in changelogs using the Liquibase Maven plugin.
Right now with my Ant project, I’ve got changelog entries like the following:
And within that changelog, I insert ${schemaname} and ${tablespace} within changesets, for example:
However, I don’t want to have to keep manually modifying changelogs each time I run Liquibase, so right now I am trying to get this simple functionality to work with Maven filtering.
Getting filtering to work is easy. In checking the project target, the above entries are filtered correctly. However, the Liquibase Maven plugin seems to be looking at the source rather than the target when processing, so the database driver complains that there are invalid characters in the SQL (the “$” and “{” characters obviously are not expected by the database).
I’ll really appreciate any help someone can offer on this topic. Is there a way to pass in custom properties to changelogs without actually putting them in the changelogs? It doesn’t make sense to keep changing the source code, and it would seem that using Maven filtering would be the solution to this issue.
I’ve seen several posts about the standard “driver”, “classpath”, and “url” etc properties that are needed for liquibase.properties, but nothing about custom properties. Alternatively, if the Liquibase Maven plugin does not offer this functionality, I’ll appreciate any other solutions you might have. Thanks very much.
-
Learn
-
Resources
-
Free Tools
OSS Risk Scanner Database DevOps Risk AssessmentCheat Sheets
Snowflake + Liquibase Databricks + Liquibase -
eBooks
6 Liquibase Community Risks & How to Avoid Guide: SOC 2 Compliance at the Database Layer Guide: Quantify the Value of Liquibase Secure -
Comparison Guides
Liquibase vs. Flyway Liquibase vs. Bytebase Liquibase Community vs Liquibase Secure
-
- Quickstart
- Get Started
- Documentation
- University
-
Resources
- Connect
- Contribute
- Join
- Blog