Mar*_*ann 8 java changeset liquibase
目前我尝试将 Liquibase 3.3.3 集成到我的项目中。为了管理我的数据库,我从应用程序中调用 Liquibase,而变更集位于 JAR 文件中
final Liquibase liquibase = new Liquibase( "db/db_changelog_master.xml",
new ClassLoaderResourceAccessor(),
database );
liquibase.update( new Contexts() );
Run Code Online (Sandbox Code Playgroud)
此调用有效并且主变更集已加载。在主变更集中,将加载更多变更集:
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<include file="classpath:db_changelog_1.0.xml"/>
</databaseChangeLog>
Run Code Online (Sandbox Code Playgroud)
问题就从这里开始了,因为 Liquibase 无法找到并加载子变更集。我还尝试了 <includeAll> 标记以及子变更集的绝对和相对路径,但没有成功。
有什么建议吗?这里有什么问题?
此致!
我的更改日志位于 src/main/resources/db/changelog/dbchange-master.xml 和 dbchange-2.xml 的其他 jar 中
如果我像这样在 master 中包含 dbchange-2.xml
<include file="classpath:/db/changelog/dbchange-2.xml" />
Run Code Online (Sandbox Code Playgroud)
有用。
| 归档时间: |
|
| 查看次数: |
7541 次 |
| 最近记录: |