简体   繁体   English

Liquibase 找不到更改日志文件

[英]Liquibase cannot find changelog file

I have following error with our spring boot 2 application:我的 spring 启动 2 应用程序出现以下错误:

Caused by: liquibase.exception.ChangeLogParseException: Error Reading Migration File: class path resource [src/main/resources/changelogs/changelog-1.0.xml] cannot be resolved to URL because it does not exist at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:118) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15) at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:525) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:334)... 190 common frames omitted Caused by: liquibase.exception.ChangeLogParseException: Error Reading Migration File: class path resource [src/main/resources/changelogs/changelog-1.0.xml] cannot be resolved to URL because it does not exist at liquibase.parser.core.xml .XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:118) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15) at liquibase.changelog.DatabaseChangeLog.include(DatabaseChangeLog.java:525) at liquibase.changelog. DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:334)... 190个常用帧省略

in application properties we have: spring.liquibase.change-log=classpath:/changelogs/changelog-master.xml在应用程序属性中,我们有: spring.liquibase.change-log=classpath:/changelogs/changelog-master.xml

All scripts are structured in spring boot's resource folder /src/main/resources/changelogs所有脚本的结构都在 spring 引导的资源文件夹/src/main/resources/changelogs

In changelogs fodler is master xml and changelog with changesets as well.changelogs中,文件夹是主 xml 和带有更改集的更改日志。

reference to changelog of changesets in master xml is like this:参考主 xml 中变更集的变更日志是这样的:

<include file="src/main/resources/changelogs/changelog-1-0.xml"/>

I cannot find reason why this isn't work.我找不到为什么这不起作用的原因。

I tried relativeToChangelogFile="true" and in file use only file="changelog-1-0.xml" and this works, why?我尝试了relativeToChangelogFile="true"并且在文件中仅使用file="changelog-1-0.xml"并且这有效,为什么?

You should not include src/main/resouces in your path inside the master changelog;您不应在主变更日志内的路径中包含src/main/resouces those directories are not reflected in the generated jar.这些目录不会反映在生成的 jar 中。 Try just changelongs/changelog-1-0.xml .试试changelongs/changelog-1-0.xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java - illegalStateException:找不到changelog位置:类路径资源(liquibase) - java - illegalStateException: Cannot find changelog location: class path resource (liquibase) Liquibase 无法找到用于 4.0 及更高版本集成测试的更改日志文件 - Liquibase is unable to find changelog file for integration tests with versions 4.0 and higher Liquibase 找不到更改日志文件 - Liquibase won't find changelog files Liquibase maven:spring-boot启动时找不到changelog位置 - Liquibase maven: Cannot find changelog location when spring-boot starts liquibase changelog文件未从默认值更新 - liquibase changelog file is not updating from default value Liquibase 在我的 jar 文件之外使用更改日志 - Liquibase use a changelog outside of my jar file 我如何使用jar文件中的Liquibase更改日志 - How do I use a Liquibase changelog which is in jar file 使用变更日志文件的副本时,Liquibase回滚静默失败 - Liquibase rollback silently fails when using copy of changelog file Liquibase - 从数据库更改中更新changelog XML文件 - Liquibase - Update changelog XML file from database changes LiquiBase 问题,类路径资源 [db/changelog/db.changelog-master.yaml] 无法解析为 URL,因为它不存在 - LiquiBase problem , class path resource [db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM