liquibase / liquibase-gradle-plugin

A Gradle plugin for Liquibase
Other
197 stars 57 forks source link

Liquibase is not using module directory as working directory. #117

Open chali opened 1 year ago

chali commented 1 year ago

I have a submodule that applies liquibase plugin then I have a sibling submodule that is an application. As part of application start I call task liquibaseUpdate.

I noticed that liquibase is using current working directory where I invoke gradle as its working directory not the submodule where plugin is applied.

E.g.

-- app
\- module-with-liquibase

I execute ./gradlew :app:run from project root. I end up starting :module-with-liquibase:liquibaseUdate and all change sets are expected to be relative from project root.

If I move to app directory and execute ../gradlew run now my changesets are expected to be relative to app directory.

Am I misapplying the plugin? Should it live only in the root modules?

Djimi commented 1 year ago

Hey @chali ,

I recently start using Liquibase, but I believe maybe that's the important part of the documentation for you:

If you are using liquibase in a subproject structure, due to a limitation in liquibase, you will need to override the user.dir using the jvmArgs. For example:

liquibase {
  jvmArgs "-Duser.dir=$project.projectDir" 
}