When we start the application in the Quarkus dev mode (mvn quarkus:dev) everything works fine; the changeLog is read and every file under the given path (db/1.0.0/) is executed/checked from Liquibase.
But if we run the application directly (with java -jar) we are getting following error:
Caused by: liquibase.exception.SetupException: Could not find directory or directory was empty for includeAll 'db/1.0.0/'
at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:528)
The resources under this given folder are just not found.
If I define the includes per file, it´s working fine:
How can we define the includeAll tags with the new Liquibase 4.0.0 version?
When starting the application with quarkus:dev, the includeAll resources defined in the changeLog.xml are read from the target/classes folder directly from the file system.
But when we start the application from the JAR, Liquibase tries to load the includeAll resources from inside the JAR file.
This is exactly the same behavior as for the older Quarkus 1.7.x / Liquibase 3.9.x version.
But in Liquibase 4.0.0 the way how the includeAll resources are looked-up has completely changed and seems to cause issues if they are in a JAR file.
The ClassLoaderResourceAccessor#listFromClassLoader method uses url.openStream() to find all the files under the given resource. But this does not work if the resources are located in a JAR.
(The 3.x.x version of the ClassLoaderResourceAccessor had some logic in it when the URL started with java:file)