运行版本3.2我收到一个错误
[WARN] liquibase - schema_reference.4:无法读取架构文档'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd',因为1)找不到该文档; 2)文件无法阅读; 3)文档的根元素不是。
当我寻找http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd它不存在,虽然http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd是。
我来到这个https://liquibase.jira.com/browse/CORE-1840,我解释说你不需要访问互联网来获得dbchangelog-3.2.xsd。当互联网可用时它似乎没有帮助,但.xsd不在那里。
我已经恢复到3.1,但想知道我的3.2问题的根本原因。
我通过使用我的应用程序分发模式并在本地引用它(相对路径)来解决它。在下面的示例中,我将架构文件与更改日志放在同一文件夹中。
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog dbchangelog-3.1.xsd">
<!-- all the things -->
</databaseChangeLog>
Liquibase不会在互联网上寻找xsd。 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd将被替换为java recources的路径
更详细的信息可以找到here
将liquibase
版本更新到最新版本解决了我的问题
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.6.3</version>
</dependency>