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

Maven: Add a workingDirectory parameter to support relative filesystem locations in conf files #1877

Closed
lbreuss opened this issue Dec 21, 2017 · 3 comments

Comments

@lbreuss
Copy link

@lbreuss lbreuss commented Dec 21, 2017

Introduce a parameter workingDirectory which shall be interpreted as the base directory of relative filesystem locations.

This will allow to reuse conf files without modifications. They preserve their originally designed relative reference to directories containing migrations, that are packaged together with the conf file.

For my schema unit tests run during maven build, I would really like to use the original bundled /src/main/resources/util/flyway/conf/flyway_latest.conf, that references filesystem:../../database/. Now if during test phase I direct flyway-maven-plugin to use the config file at /target/util/flyway/conf/flyway_latest.conf, the relative path currently does not evaluate to /target/database/, but to /../../database/ (leading "/" denoting the project root), which is an inexistent path and even outside the maven project. Currently, as a workaround, I have to use a manipulated version of flyway_latest.conf, which is not optimal for unit testing what's beeing packaged...

Related to issue 944, which implemented a fixed current working directory.
In reply to @jedvardsson, I'm not a big fan of introducing a not-so-obvious semantics of ./path vs. path.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Feb 14, 2018

I'm currently leaning towards exposing this in the core, to make it accessible to all clients (API, Maven & Gradle).

@axelfontaine axelfontaine changed the title Implement a workingDirectory parameter to support relative filesystem locations in conf files Maven: Add a workingDirectory parameter to support relative filesystem locations in conf files May 23, 2018
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue May 23, 2018
@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented May 23, 2018

This has now been implemented for Maven. Opened a new issue for other clients: #2022

dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
… relative filesystem locations in conf files
@lbreuss
Copy link
Author

@lbreuss lbreuss commented Sep 2, 2020

Thanks for implementing. I can't get it to work in maven, so I'll open a Bug with a small testcase. (On the command line, I successfully tested the feature, #2022.)

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.