Issue
I've got one problem with liquibase-maven-plugin 4.2.2. If I specify the path to logs like it was before
changeLogFile= classpath:db/changelog/db.changelog-master.xml
I'm getting an error
Error Reading Changelog File: Found 2 files that match classpath:db/changelog/db.changelog-master.xml: jar:file:/Users/macbook/IdeaProjects/geek-study-eshop/shop-database/target/shop-database-1.0-SNAPSHOT.jar!/db/changelog/db.changelog-master.xml, file:/Users/macbook/IdeaProjects/geek-study-eshop/shop-database/target/classes/db/changelog/db.changelog-master.xml
I understand the reason for this error and it possible to resolve it by changing changeLogFile
to target/db/changelog/db.changelog-master.xml
. But in this case, I will have target\
prefix in filenames stored in DATABASECHANGELOG
table. But I don't want that for some reasons. I want all file names there to be with prefix db/changelog/...
or classpath:db/changelog/...
. Is that possible to do that somehow without using logicFilePath
attribute?
Solution
I found the solution! There is no way to change liquibase-maven-plugin
behavior but it's possible to change maven phase on which we run liquibase:diff
command. Simply use mvn clean compile liquibase:diff
! We are doing diff after compilation and resource movement but before the jar packaging.
Answered By - Alexey Usharovski