We're updating the issue view to help you get more done. 

includeAll requires files to be part of the application running Liquibase, external files are discarded

Description

Hi,

I'm using Liquibase within a Spring Boot application, and I have the need to load the changesets from some place on the file system, outside of the application. My configuration is as follows (/some/absolute/path/db.changelog-master.yaml):

1 2 3 databaseChangeLog: - includeAll: path: /some/absolute/path/changes/

And the application is launched with -Dspring.liquibase.changeLog=/some/absolute/path/db.changelog-master.yaml, which causes that configuration to be loaded as expected.

Unfortunately, later on the application of the change sets fails with cause:

1 2 Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'file:/some/absolute/path/changes/' at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:484)

Just to be clear: the directory I gave is not empty.

I could debug the code and determine that the files are first listed but then discarded at that point of the code:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 @Override public Set<String> list(String relativeTo, String path, boolean includeFiles, boolean includeDirectories, boolean recursive) throws IOException { // ... Resource[] resources = getResources(adjustClasspath(tempFile)); for (Resource resource : resources) { String resourceStr = resource.getURL().toExternalForm(); String resourcePath = convertToPath(resourceStr); // HERE ------v if (resourceStr.endsWith(resourcePath) && !resourceStr.equals(resourcePath)) { returnSet.add(resourcePath); } else { // ... } // ... } }

Also, I've seen that this area of Liquibase's codebase has changed recently.
Could those changes fix the problem described above? And is there any date scheduled for the release of the next version of Liquibase?

I thank you all in advance for considering that case.

Environment

I'm using Liquibase within a Spring Boot application.

Status

Assignee

Unassigned

Reporter

Nicolas Grisey Demengel

Labels

None

Components

Affects versions

3.6.3

Priority

Major