changelog filename in database contains full OS path?

I am having hard time configuring Liquibase in current project. The problem is that each time I switch from one dev machine to another, Liquibase goes crazy and tries to reapply all the changelogs.

The problem is the databasechangelog table contains FULL OS path, from machine that was used to run the changelog, like:
I cannot remember having such issues in previous project. The difference is that previously, the Liquibase was launched by an application, in current project it is launched by maven plugin.

Is it a bug?

Witold Szczerba

P.S.I have came across many threads about the pain related to filenames in databasechangelog table (including my case) and I cannot get the reason behind it. There is ID and an author. It is not that hard for authors to keep track of the IDs they use. In my project we use a pattern: year-month-day-seq, where seq is a sequence number in that day per author. Impossible to create two identical ID by mistake, but let’s assume author created duplicated ID: Liquibase could throw an exception (duplicated ID detected), author would correct the ID and problem solved.
I would strongly advise to reconsider the filename in changelogs. They cause lots of troubles.

This is my first post here, I would like to thank the authors and contributors for making such a great tool!

Unless I’m missing the essence of your problem, the simple solution is to put logicalFilePath=“db.changelog.001” either in your <databaseChangeLog or <changeSet tags

The reason it is storing the absolute paths is probably because you are referencing it or the root changelog absolutely. The best way to run liquibase is to have your changelog files in your classpath and then reference the all changelogs as classpath-relative. That way you can change where the files actually are across servers and across time and everything will still work.


Yes, you can add it to



Hmm, you are right, this is how it is configured in Maven’s pom.xml, attaching for reference.
Is it possible to reference the location of changelog classpath relative?

By the way: I cannot move the Liquibase process to application startup, because I need migration to happen before compilation of my main application (JOOQ generates classes required to compile the app).

  2.         org.liquibase
  3.         liquibase-maven-plugin
  4.         2.0.5
  7.             sgn-db
  8.             process-resources
  10.               update
  13.               ${project.basedir}/src/main/resources/sgn-core/db/db.changelog.xml
  14.               ${sgn.db.driver}
  15.               ${sgn.db.url}
  16.               ${sgn.db.user}
  17.               ${sgn.db.pass}
  18.               false

I cannot run Liquibase after compilation, because my project won’t compile because of missing classes.
It goes like this:

  1. sgn-db mvn project:
    1. Liquibase upgrades (or creates) database,
    2. JOOQ generates classes,
  2. sgn mvn project depends on sgn-db,
    1. compiles code using classes generated in step #1.2
    2. sgn mvn starts unit and database integration tests,
  3. sgn gets deployed

So, it looks like there is no way I can resolve the issue other than following pmendelson workaround. One possible solution would be to allow setting a base path in configuration somewhere, so all the files would be located and identified starting from that path. Additionally it would be nice if there would be an option to get rid of the file names in changelogs all together.

Should I report this in some issue tracking system?

Witold Szczerba

I was just asking if this is a bug, because it seems like it is.

Setting logicalFilePath is a nice workaround for the problem, though it needs to be used in every single file. If one forgets to apply it in a new file, the changelog table will suffer and need manual recovery.

Witold Szczerba

Now hear this: the problem I am facing was already resolved and described in manual. I have just missed it:

Paths to files

As of version of the Maven plugin all files are resolved from the maven test classpath for the Maven project or an absolute path. This allows for DatabaseChangeLogs to be present in other Maven artifacts (on the classpath) and able to be used to invoke liquibase on a database.

So all I had to do was to get rid of ${project.basedir}/src/main/resources/, see the diff:
  1. -  ${project.basedir}/src/main/resources/sgn-core/db/db.changelog.xml
  2. + sgn-core/db/db.changelog.xml

Witold Szczerba

I’m not a big maven guy, but it looks like the Maven plugin just uses the maven project classpath as the classpath to search. If you have to run liquibase before the compilation phase, that won’t be available yet.

You can’t run JOOQL after the compliation, or configure maven to run liquibase before JOOQL within compilation?

You can subclass the liquibase maven classes and override the getFileOpener() method, but I’m not sure how easy that is to integrate into maven.


Seems like the best place to discuss would be with the gradle plugin developers. There are only 3 people that have contributed to it. The main person seems to be Steve Saliman.

Here is the github link for the plugin project:

Steve Donie
Principal Software Engineer
Datical, Inc.

I know this is an old thread however, I am having the same issue using the Gradle plugin. It seems to behave differently depending on if I run the script from the parent project or within the sub-project. If I run it inside the subproject, it uses an absolute path. If I run from the parent project, it uses the shorter path (like “src/db/main/changelogs/changelogxyz.sql”).

This seems to cause a ton of grief for people including myself. I wished it was as simple as absolutePath=“true”/“false”