- 
                Notifications
    
You must be signed in to change notification settings  - Fork 3k
 
Description
With Quarkus 1.5 the Liquibase integration has an issue (Liquibase version: 3.9.0).
The combination of quarkus:dev and Liquibase changeLog.xml with an includeAll tag does not find the files under a given folder. It always says:
File does not exist: D:/Projekte/myproject/target/classes/db/1.0.0/0010_init.sql
In Quarkus 1.4.x this was working fine.
If I run Quarkus tests with the same Liquibase changeLog.xml or if I start the application via the runner JAR, the referenced Liquibase files are found.
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd"> <includeAll path="db/1.0.0/" errorIfMissingOrEmpty="true"/> </databaseChangeLog> 
This is working in all modes:
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd"> <include file="db/1.0.0/0010_init.sql"/> </databaseChangeLog>
It seems that the modification to the QuarkusClassLoader has something to do with it.
Liquibase liquibase.util.StreamUtil#singleInputStream tries to load the files referenced by the includeAll tag via resourceAccessor.getResourcesAsStream(path).
This uses the QuarkusClassLoader which returns NULL in quarkus:dev mode, but the expected stream if running QuarkusTests or when application is started with the -runner JAR.