Error while including resources with includeAll directive

Description

Suppose, you have a jar file containing some of your changesets. On your main project, you have a dependency on this jar file. Something like this:

Using the project structure above, only file1.xml will be included when using this configuration:

This happens because inside class ClassLoaderResouceAcessor, before adding the file2.xml to the return set, it is verified if it starts with the path found, which is jar:file:/home/felipe/.m2/repository/<path-to-my-dep.jar>/dep.jar!/db/changelog/. While the correct path should be db/changelog/.

I believe the error is in class SpringLiquibase.

Environment

Maven home: /opt/maven
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-112-generic", arch: "amd64", family: "unix"

Activity

Show:

Julio Noda October 29, 2019 at 2:01 PM

I’m having exactly the same issue. It happens when launching integration tests with Spring Boot Maven plugin as documented here.

Miroslav Zaťko October 12, 2019 at 10:01 AM

It doesn’t seem to be fixed even for spring-boot 2.1.9.RELEASE + liquibase 3.8.0

 

It finds all files but it consider it “not valid“.

Just a note: when I use <include file=”…” /> with the same files, everything is correct. Means it is not about content of files.

Nathan Voxland January 18, 2019 at 6:11 PM

Former user September 10, 2018 at 5:41 PM
Edited

The problem occurs while listing the resources on SpringLiquibase. Here is how I fixed it. If you want, I can post a PR.

Ilya Gavrikov June 14, 2018 at 5:44 PM

I get the same error on Liquibase 3.6.1 with migration XMLs located in the same JAR as the rest of my project. Example test case mimicking the real-life setup I have is available here: https://github.com/Eng1N33R/liquibase-migration-issue

https://github.com/liquibase/liquibase/pull/779 references this and corrects the error.

Fixed

Details

Reporter

Components

Fix versions

Affects versions

Priority

Created March 19, 2018 at 8:42 PM
Updated October 29, 2019 at 2:01 PM
Resolved January 18, 2019 at 6:11 PM