我正在开发一个spring-shell数据库迁移工具。
目前,我试图在groovy-dsl扩展中使用液化碱。我的build.gradle包括扩展jar,我还在spring-shell-plugin.xml中声明了液化基
spring-shell-plugin.xml
<bean id="liquibase" class="liquibase.integration.spring.SpringLiquibase" depends-on="postgresService">
<property name="dataSource" ref="psqlDataSource"/>
<property name="changeLog" value="com.example.db.DbChangelog_master"/>
<property name="defaultSchema" value="${postgres.schema}"/>
</bean>但每次启动应用程序时,液化库都会抛出以下错误
Caused by: liquibase.exception.UnknownChangelogFormatException: Cannot find parser that supports com.example.db.DbChangelog_master
at liquibase.parser.ChangeLogParserFactory.getParser(ChangeLogParserFactory.java:70)
at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:226)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:434)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 13 more文档有点少,jar也包含在类路径中。
groovy脚本需要在src/main/resources中吗?目前,它们在src/main/groovy中的一个单独的包中。
发布于 2016-03-09 15:31:23
我觉得你的财产
<property name="changeLog" value="com.example.db.DbChangelog_master"/>是不正确的。这应该是您的changelog文件的路径。如果该文件是groovy文件,则可能是
<property name="changeLog" value="DbChangelog_master.groovy"/>如果该文件在类路径上可用。
https://stackoverflow.com/questions/35895595
复制相似问题