tlberglund/gradle-liquibase-plugin

Latest plugin change 1.0.1 Cannot find parser that supports groovy

Closed this issue · 7 comments

I've been using the 1.0.0 (Liquibase 3.1.x) version happily with a full configuration structure for multiple schemas and a mix of .groovy and .xml changelogs and custom extensions.

Simply changing the plugin to 1.0.1 to pick up the latest Liquibase versions throws this error on update:
Error:
Unexpected error running Liquibase: Cannot find parser that supports /home/vagrant/workspace/project/Liquibase/install/core/core-changelog.groovy

As part of the upgrade is there anything else I would need to change for it to just work as it has been?

Thanks
Warren

Just to confirm when I say a mix of changelogs I mean the liquibase plugin is configured for each schema to find a .groovy changelog. Each of those 'master' changelogs includes a mix of .groovy or .xml files which are either .groovy or .xml changelogs themselves.

There shouldn't be anything needed to go from 1.0.0 to 1.0.1, other than just bumping the version number. The error you're seeing seems to suggest that the plugin hasn't registered the Groovy DSL with Liquibase itself before calling it with your main changelog.

I'm not sure exactly where to look next. I've got a couple of projects here that use .groovy files just fine, and in our case, we've got a master .groovy file that includes other .groovy files without issue. Is /home/vagrant/workspace/project/Liquibase/install/core/core-changelog.groovy a changelog mentioned in your build.gradle, or is it one of the files included by something else?

I did update the version of Groovy that the Groovy DSL expects, is there anything fancy in your .groovy file? This one is a bit of a long shot because I'd expect a different kind of error if the file itself was somehow invalid.

I took another look at the code. The plugin doesn't actually register the parser, Liquibase automatically finds any parsers in the classpath, and slects the right one based on the extension. I can't think of anything that changed in the plugin, but I wonder if something might have changed in liquibase itself. The easiest way to test this would be to use version 1.0.0 of the plugin, but exclude the Liquibase dependency, then add Liquibase 3.3.2 to the buildscript dependencies. Does that make a difference?

I think I may have found something. Are you using Java 6 or 7 by chance? It looks like the Groovy DSL was compiled with Java 8, and there was no sourceCompatibility set in the Groovy DSL project. Liquibase was silently ignoring .class files it couldn't understand.

I've uploaded a new version of the Groovy DSL that is compiled for backwards compatibility, and a new version of the plugin that uses the new DSL to the Maven Snapshot repository. What happens if you bump the version of the Liquibase plugin to 1.0.2-SNAPSHOT?

Yes we are using Java7. We are restricted to this version because of the current platform we are building for. We're use this against Oracle Commerce Web (ATG) and its latest versions will probably be stuck on Java 7 for a while still.
The 1.0.2-SNAPSHOT version worked without issue against all our schema variations, so that seems to be the solution (for our projects anyway).

I've just released version 1.0.2 to the regular Maven Central repository. It should be available on Maven Central shortly.

Thank you for finding this. It is probably causing grief for a lot of people.

It all works great, thanks for the quick response!