I managed to get this working. The key was to use the maven filter element in conjunction with the resource element as explained in Liquibase Documentation.
Also it's important to include the resources goal in the maven command:
mvn resources:resources liquibase:update -Plocal
This is the file hierarchy I used:
|-- pom.xml
`-- src
`-- main
|-- resources
| `-- liquibase.properties
| |-- changelog
| `-- db-changelog-master.xml
| `-- db-changelog-1.0.xml
|-- filters
|-- local
| `-- db.properties
|-- dev
| `-- db.properties
The db.properties file would look like the following:
database.driver = oracle.jdbc.driver.OracleDriver
database.url = jdbc:oracle:thin:@<host_name>:<port_number>/instance
database.username = user
database.password = password123
The liquibase.properties file would look like the following:
changeLogFile: changelog/db.changelog-master.xml
driver: ${database.driver}
url: ${database.url}
username: ${database.username}
password: ${database.password}
verbose: true
The POM file would look like the following:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<propertyFile>target/classes/liquibase.properties</propertyFile>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<filters>
<filter>src/main/filters/local/db.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
<profile>
<id>dev</id>
<build>
<filters>
<filter>src/main/filters/dev/db.properties</filter>
</filters>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</profile>
</profiles>