我有一个要求,要从其他项目模块中将包含变更集的变更日志文件作为Maven依赖项来提取。我需要在当前项目中包括其他项目的主变更日志文件(已引用其中的所有变更集),从该文件中我将执行Maven Liquibase更新/回滚或Spring Boot Liuqibase设置。有没有办法使它起作用?
我尝试这样做,如下所示
<?xml version="1.0" encoding="UTF-8" standalone="no"?><databaseChangeLog
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangeloghttp://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">
<property name="blob" value="bytea" dbms="postgresql"/>
<property name="blob" value="blob" dbms="derby"/>
<preConditions>
<or>
<dbms type="derby"/>
<dbms type="postgresql"/>
</or>
</preConditions>
<include file="db/changelog/db.changelog-master.xml"/>
<include file="db/changelog/changesets/2019-06-001-modeler.changelog.xml"/>
</databaseChangeLog>
但是我得到了错误设置或运行Liquibase时出错:liquibase.exception.SetupException:读取迁移文件时出错:找到2个与db / changelog / db.changelog-master.xml匹配的文件
我在所有项目中都有相同的文件夹结构。
Liquibase无法理解应使用哪个名称相同的文件。如果可能,您应该更改更改日志的路径。因此,如果您的变更日志都在路径db/changelog/db.changelog-master.xml
上,请尝试至少重命名路径。例如,使用db/changelog/module1/db.changelog-master.xml
或db/changelog/db.changelog-module1-master.xml
。
这是前一段时间的一个报告错误,现在已在更高版本的Liquibase中修复。请尝试使用最新的Liquibase版本,看看问题是否消失。
以下是Liquibase版本的参考。https://github.com/liquibase/liquibase/releases