Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify working directory #57

Closed
matteoturra opened this issue Mar 29, 2019 · 2 comments
Closed

Specify working directory #57

matteoturra opened this issue Mar 29, 2019 · 2 comments

Comments

@matteoturra
Copy link

I put my change log in the src/main/db directory. Is it possible to specify this directory as "working directory" used to resolve absolute path in include element.
Which is the default directory from which all path are resolved launching the plugin tasks?

@stevesaliman
Copy link
Collaborator

The default directory for resolving relative paths is the root directory of the project.

Let's say that your main changelog is in src/main/db, and the included changelogs are in src/main/db/include. , There are two ways you can resolve paths in an include element.

The first is to use path: "src/main/db/include" in your include elements, which tells Liquibase to find them relative to Gradle's working directory

The second is to use path: 'include', relativeToChangelogFile: true in your include elements, which tells Liquibase to find them relative to the changelog file itself.

@gavenkoa
Copy link

Check https://stackoverflow.com/questions/27187979/gradle-liquibase-change-log-file-could-not-be-found

liquibase {
   activities {
      main {
         // Real path: $subproj/src/main/resources/db/master.xml
         changeLogFile 'db/master.xml'
         // Allows to strip "src/main/resources".
         classpath "${projectDir}/src/main/resources"

         url 'jdbc:mysql://localhost:3306/test'
         username 'XXX'
         password 'XXX'
     }
  }
 runList = 'main'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants