1
votes

I have installed Liquibase runner 1.3.0 plugins in Jenkins and trying to execute liquibase changelog script file which I got after executing 'diffChangeLog' command. While executing script file, I am getting Failed to read schema document 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd' as exception. I have checked my changelog file and it has below mentioned header.

<?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">

But now here, when I replace '3.8' to '3.5' in both the location in the header, then its getting executed successfully. I want this to get executed with '3.8' only. Please help.

3

3 Answers

4
votes

The header in the changelog specifies only which xsd (XML Schema Description) is used when parsing the changelog xml file into objects. That xsd is embedded in the liquibase jar file that is being used when the command runs. The issue that you are facing is that the Liquibase Runner plugin for Jenkins v 1.3.0 has an older version of the liquibase jar embedded in it. If you look at the change history for that plugin, you will see that it includes version 3.5.3 of Liquibase, so you can only use XML tags that were available in that version. You can set the xsd to reference version 3.5.

The folks at Liquibase (including myself) are currently working on releasing a newer version of the Liquibase runner plugin for Jenkins that would have a newer version of Liquibase in it. I am working with the original author to resolve the security issues that the Jenkins team has flagged. I don't have a date when that will be done. You could build the plugin yourself if you need it sooner, applying PR#16 to your local copy before building it. The source code for the plugin is at https://github.com/jenkinsci/liquibase-runner-plugin

If you'd like to learn more about Liquibase XML and xsd, I have written a section in the Liquibase FAQ that covers this topic.

0
votes

I saw this error when running a Spring Boot project, but SteveDonie's answer still led me to my solution. The cause of the error is that the changelog file was created with a newer version of Liquibase than what is running. For me, I had to update the liquibase version in my maven pom.

0
votes

Maybe i can help somebody!:)

  1. Check all your files in resources/db/changelog/* ! If you change in one file -> you must do it anywhere! I think it must be similar;
  2. Check https://docs.liquibase.com/concepts/basic/xml-format.html official documentation liquibase, its best for you, because information in official doc is actualite.

PS sorry for my english:)