3
votes

When I'm trying to start changelog.groovy via liquibase command line it tells me that

Unexpected error running Liquibase: Cannot find parser that supports changelog.groovy

I'm doing the next: java -jar liquibase.jar update

My liquibase.properties are:

  • driver=org.postgresql.Driver
  • classpath=C:\Users\Andrii\org.postgresql.Driver.jar;C:\Users\Andrii\liquibase-3.5.1-bin\lib\liquibase-groovy-dsl-1.2.2-SNAPSHOT.jar
  • changeLogFile=D:\changelog.groovy
  • url=jdbc:postgresql://localhost:5432/test
  • username=postgres
  • password=rup

It finds those jars since if I change something in that path it will tell that jars cannot be found.

I downloaded the groovy-liquibase-dsl project, build it and added a jar into classpath. What am I doing wrong?

1
I have never used the groovy parser myself but it seems to be a plugin. So I guess you need extra-download the plugin and include the jar in your classpath. Did you do that?Jens
I did but no reaction. Still the same.user2620644
Edit you question and show how you did it. Presumably you did something wrong if liquibase can't find it.Jens
You could try to add it to the classpath on commandline. java -jar liquibase.jar --classpath=C:\Users\Andrii\org.postgresql.Driver.jar;C:\Users\Andrii\liquibase-3.5.1-bin\lib\liquibase-groovy-dsl-1.2.2-SNAPSHOT.jar update. Also, you should not have build anything. Just download the release for the groovy plugin here: github.com/liquibase/liquibase-groovy-dsl/releases.Jens
But that release doesn't contain any jars that have to be added to classpath. I need to build that project to obtain jars, right?user2620644

1 Answers

2
votes

To make it work, you need to additionally include groovy and groovy-sql jars in Liquibase's classpath.

So say you store all the jars in C:\Users\Andrii\LiquibaseDependencies, update your the classpath property of your file as such:

classpath=C:\Users\Andrii\LiquibaseDependencies\org.postgresql.Driver.jar;
C:\Users\Andrii\LiquibaseDependencies\liquibase-groovy-dsl-1.2.1.jar;
C:\Users\Andrii\LiquibaseDependencies\groovy-2.4.6.jar;
C:\Users\Andrii\LiquibaseDependencies\groovy-sql-2.4.6.jar