-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Path normalization breaks classpath-relative paths with a custom ResourceAccessor #5878
Comments
Hi @andrus, thank you for reporting this issue.
I'd recommend the opposite, considering that you have a possible solution - if you submit a PR we can test it and see what/if it breaks. Our development team is always available to provide guidance or discuss changes if needed. Please consider submitting a PR, and let me know if you have any questions. |
Search first
Description
I am trying again to upgrade Bootique.io framework to Liquibase 4.x from 3.x. An earlier issue #3105 was fixed in LB 4.17, and helped us to move forward. However, there are still a few places where the base path of a resource is altered, so the relative resources can not be properly resolved inside a custom ResourceAccessor. The culprit is stripping the
classpath:
prefix during path normalization. So this change toDatabaseChangeLog.normalizePath(..)
fixes everything for me:But I suspect such a change may break things elsewhere, so not sending a PR just yet 😀 Instead, let me point to some of the call spots for
normalizePath(..)
that resulted in broken relative resources, and maybe someone can suggest a proper solution, such as an alternative normalize method that preserves the "protocol" prefix in paths:liquibase/liquibase-standard/src/main/java/liquibase/parser/core/yaml/YamlChangeLogParser.java
Line 46 in d956d5f
liquibase/liquibase-standard/src/main/java/liquibase/parser/core/xml/AbstractChangeLogParser.java
Line 20 in d956d5f
liquibase/liquibase-standard/src/main/java/liquibase/changelog/DatabaseChangeLog.java
Line 969 in d956d5f
Steps To Reproduce
This test on branch 123 fails: https://github.com/bootique/bootique-jdbc/blob/123/bootique-jdbc-junit5-derby/src/test/java/io/bootique/jdbc/junit5/derby/DerbyTester_Liquibase_RelativeIT.java
Expected/Desired Behavior
The framework code setting
DatabaseChangeLog.physicalFilePath
(either via constructor or setter) should not strip an optional "protocol" (such asclasspath:
) from the path. This will allow to apply the same protocol to relative child resources.Liquibase Version
4.27.0
Database Vendor & Version
No response
Liquibase Integration
Bootique.io
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: