【问题标题】:Liquibase 3.2 not finding dbchangelog-3.2.xsdLiquibase 3.2 未找到 dbchangelog-3.2.xsd
【发布时间】:2014-07-07 12:32:01
【问题描述】:

运行 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 问题的根本原因。

【问题讨论】:

  • 3.2.xsd 现已上传,因此应该可以访问,但不应被 liquibase 获取。您是在代理后面运行还是有任何其他奇怪的网络设置?
  • 不,据我所知没有什么异常。它当然只有在我保存 .xsd 的本地副本并将其更改为硬编码链接地址时才有效。当时我认为,如果没有互联网访问,您必须只使用本地副本,而不包括互联网可用但.xsd不存在的情况。
  • 它不应该使用网络。您能否使用 3.2.1 进行测试,如果您仍然遇到问题,请在 liquibase.jira.com 上打开一个问题,包括您的 xml 标头?
  • 我在网络代理后面,并且在尝试使其正常工作时遇到了重大问题。得到与问题相同的错误,为什么架构不只是包含在 jar 中。

标签: liquibase


【解决方案1】:

liquibase 版本更新到最新解决了我的问题

<dependency>
    <groupId>org.liquibase</groupId>
    <artifactId>liquibase-maven-plugin</artifactId>
    <version>3.6.3</version>
</dependency>

【讨论】:

    【解决方案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>
    

    【讨论】:

      【解决方案3】:

      Liquibase 不在 Internet 中寻找 xsd。 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.2.xsd 将被替换为 java 资源的路径

      更多详细信息可以找到here

      【讨论】:

        【解决方案4】:

        我在找到here 之后解决了这个问题。

        该解决方案仅适用于使用 maven-liquibase-plugin 的解决方案。 您必须使用以下选项 -Dprefer.internal.xsd=true 运行 liquibase 迁移:

        mvn -Dprefer.internal.xsd=true liquibase:update

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2016-12-11
          • 1970-01-01
          • 1970-01-01
          • 2020-06-25
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多