文件搜索主机中内置的Travis CI存在java问题。通过Liquibase实现xml
请告诉我。我的项目是在当地建造的,没有任何问题。但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类
[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
文件^{
<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>
# 1 楼答案
你看过这篇文章了吗https://docs.liquibase.com/concepts/basic/liquibase-relative-path-best-practices.html
Liquibase 4.0及更高版本似乎不允许指定绝对路径。相反,使用类路径中包含的相对目录的路径