【问题标题】:Failed to read schema document 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd'无法读取架构文档“http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd”
【发布时间】:2020-06-25 03:56:37
【问题描述】:

我在 Jenkins 中安装了 Liquibase runner 1.3.0 插件,并尝试执行我在执行“diffChangeLog”命令后得到的 liquibase 更改日志脚本文件。在执行脚本文件时,我收到 Failed to read schema document 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd' 作为异常。 我检查了我的变更日志文件,它有下面提到的标题。

<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xmlns:pro="http://www.liquibase.org/xml/ns/pro"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext
                        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
                        http://www.liquibase.org/xml/ns/pro
                        http://www.liquibase.org/xml/ns/pro/liquibase-pro-3.8.xsd
                        http://www.liquibase.org/xml/ns/dbchangelog
                        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">

但是现在在这里,当我在标题中的两个位置将“3.8”替换为“3.5”时,它就会成功执行。我希望仅使用“3.8”执行此操作。 请帮忙。

【问题讨论】:

    标签: jenkins jenkins-pipeline liquibase liquibase-sql


    【解决方案1】:

    更改日志中的标头仅指定在将更改日志 xml 文件解析为对象时使用哪个 xsd(XML 架构描述)。该 xsd 嵌入在命令运行时正在使用的 liquibase jar 文件中。您面临的问题是 Jenkins v 1.3.0 的 Liquibase Runner 插件中嵌入了旧版本的 liquibase jar。如果您查看the change history for that plugin,您会看到它包含 3.5.3 版的 Liquibase,因此您只能使用该版本中可用的 XML 标记。您可以将 xsd 设置为参考版本 3.5。

    Liquibase 的人员(包括我自己)目前正在为 Jenkins 发布更新版本的 Liquibase 运行器插件,其中包含更新版本的 Liquibase。我正在与原作者合作解决 Jenkins 团队标记的安全问题。我没有具体的日期。如果您需要它,您可以自己构建插件,applying PR#16 to your local copy before building it。该插件的源代码在https://github.com/jenkinsci/liquibase-runner-plugin

    如果您想了解有关 Liquibase XML 和 xsd 的更多信息,我写了a section in the Liquibase FAQ that covers this topic

    【讨论】:

    • 感谢史蒂夫的回复。同时,我将在 Jenkins 中使用 3.5.3 版的 Liquibase。
    【解决方案2】:

    我在运行 Spring Boot 项目时看到了这个错误,但 SteveDonie 的回答仍然让我找到了我的解决方案。错误的原因是更改日志文件是使用比正在运行的更新版本的 Liquibase 创建的。对我来说,我必须在我的 maven pom 中更新 liquibase 版本。

    【讨论】:

      【解决方案3】:

      也许我可以帮助别人!:)

      1. 检查资源/db/changelog/* 中的所有文件!如果您在一个文件中进行更改 -> 您必须在任何地方进行!我想一定是相似的;
      2. 查看https://docs.liquibase.com/concepts/basic/xml-format.html官方文档liquibase,它最适合你,因为官方文档中的信息是真实的。

      PS 对不起我的英语:)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-12-04
        • 2015-06-10
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多