0

I am developing a spring-shell database migration tool.

At the moment i try to use liquibase with the groovy-dsl extension. My build.gradle includes the extension jar, also i declared liquibase in the 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>

But everytime i start the application liquibase throws the following error

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

The documentation is a bit rare, also the jar is included in the classpath.

Does the groovy scripts need to be in src/main/resources? Currently they are in a seperate package in src/main/groovy

Tobias Timm
  • 1,855
  • 15
  • 27

1 Answers1

1

I think that your property

<property name="changeLog" value="com.example.db.DbChangelog_master"/>

is incorrect. This should be the path to your changelog file. If that file is a groovy file, it might be

<property name="changeLog" value="DbChangelog_master.groovy"/>

if that file is available on the classpath.

SteveDonie
  • 8,700
  • 3
  • 43
  • 43