通过 Liquibase 在文件搜索 master.xml 中构建 Travis CI 的问题

Problems with the build in Travis CI in the file search master.xml via Liquibase

请告诉我。我的项目是在本地构建的,没有问题。但是 Travis CI 在构建中遇到错误:

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:4.2.2:update (default) on project: 

[ERROR] Error setting up or running Liquibase:
[ERROR] The file /home/travis/build/.../src/db/master.xml was not found in
[ERROR]     - /home/travis/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar...

甚至更低:[ERROR] - /home/travis/build//target/test-classes

[ERROR] Specifying files by absolute path was removed in Liquibase 4.0. Please use a relative path or add '/' to the classpath parameter.

我在本地遇到了类似的错误,但是对于另一个文件,master.xml,其中写入了 <include file="src/db/scripts/update_001.sql"/> 的路径 - 我修复了它,因此项目正在本地构建。但是在 Travis 中,它看起来像一个类似的错误,但是对于文件,master.xml.

文件中的设置pom.xml:

<plugin>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-maven-plugin</artifactId>
    <version>4.2.2</version>
    <configuration>
        <changeLogFile>${basedir}/src/db/master.xml</changeLogFile>
        <url>${db.url}</url>
        <driver>${db.driver}</driver>
        <username>${db.username}</username>
        <password>${db.password}</password>
    </configuration>
    <executions>
        <execution>
            <phase>process-resources</phase>
            <goals>
                <goal>update</goal>
            </goals>
        </execution>
    </executions>
</plugin>

路径拼写正确:

<changeLogFile>${basedir}/src/db/master.xml</changeLogFile>

你看过这篇文章了吗? https://docs.liquibase.com/concepts/basic/liquibase-relative-path-best-practices.html

好像Liquibase 4.0以后的版本不允许指定绝对路径。相反,使用类路径中包含的路径相关目录。