Home > database >  changelog directory not found after spring boot 3 upgrade
changelog directory not found after spring boot 3 upgrade

Time:01-10

After upgrade to spring boot 3, liquibasebase throws error liquibase.exception.UnexpectedLiquibaseException: java.io.FileNotFoundException: JAR entry db/scripts/dml/importstatus.sql not found

the correct path is db/changelog/scripts/dml/importstatus.sql, somehow "changelog" gets removed. Other changeSets work fine, error only happens in sqlFile with property

    <property name="script-dir" value="scripts/dml" dbms="postgresql"/>

    <changeSet id="insert-import-status">
        <sqlFile path="${script-dir}/importstatus.sql"
                 splitStatements="false"
                 stripComments="false"
                 encoding="utf8"
                 relativeToChangelogFile="true"
                 endDelimiter=";"/>
    </changeSet>

I tried to use path without property, use "scripts/dml/importstatus.sql" but still got same error.

CodePudding user response:

This is a bug in Liquibase 4.17: https://github.com/liquibase/liquibase/issues/3393

Unfortunately, the Spring Boot dependency management suggests 4.17.2 in the latest releases, as 4.17 was the latest minor release at the time when Spring Boot 3 went GA.

You can either downgrade to 4.16.2 or upgrade to 4.18.0. For example, by overriding the property liquibase.version in your build.

  • Related