문제
generateChangelog를 돌려서 새로운 data.xml과 schema.xml을 생성해 적용하였다.
Jenkins에서 Build 돌 때, 아래와 같이 liquibase 관련하여 Failed to read schema document 'http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd' 에러가 났다.
원인
liquibase의 xsd 파일로, data.xml과 schema.xml의 문법이 맞는지 검증한다.
https://forum.liquibase.org/t/different-versions-of-dbchangelog-xsd-in-project/7775
로컬에 설치된 liquibase 4.25 버전으로 data.xml, schema.xml을 새로 생성하였다.
pom.xml에서 보면 애플리케이션에서 사용하는 liquibase의 버전은 3.9.0이다.
해결
생성한 data.xml과 shcema.xml에서 latest.xsd를 가져오는 것을 application 버전에 맞게 내려준다.
아래는 문제가 되었던 schema.xml의 헤더이다.
<?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-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
이 부분에서 latest를 3.9로 변경해준다.
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.9.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
마찬가지로, data.xml에 있는 헤더도 latest에서 3.9로 변경해준다.
<?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-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.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.9.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.9.xsd">
'트러블슈팅' 카테고리의 다른 글
Test 코드에서 h2 database로 MySql 쿼리 실행 시 row_number에서 syntax 에러 (0) | 2024.01.25 |
---|---|
Jenkins나 Spring Boot에서 Test 시, liquibase 외래키 참조 에러 (1) | 2024.01.10 |
liquibase의 changelog인 schema.xml과 data.xml을 생성해주는 ShellScript 만들기 (0) | 2024.01.09 |
터미널에서 liquibase 실행 시, zsh: command not found: liquibase 에러 (0) | 2024.01.09 |
Oracle 실행 계획 보기. 개발 DB와 운영 DB의 쿼리 속도가 차이나는 이유 (0) | 2023.12.11 |