tlberglund/gradle-liquibase-plugin

Plugin reports success even if changesets fail

Closed this issue · 3 comments

When a changeset fails for whatever reason, a stack trace is printed on the console, but Gradle reports a successful build. Aside from being an incorrect status, this can cause issues. For example, suppose you have a CI server set to build and test your project. If the "gradle update" fails, ther's no sense trying to run the project's tests, but that is currently what would happen because the Liquibase plugin didn't report a failure.

I think the heart of the matter is in Main.java around lines 136 and again about 20 lines later. In both cases, we're in a catch block where the exception is logged, then eaten. I think the exception should be thrown so that Gradle registers this as a failure. If we throw the exception out to Gradle, we might not need to log the exception, which would clean up the code even further. Even cleaner still, we could skip the whole try/catch thing altogether since we need to throw exceptions to get Gradle to report failure anyway.

What do you think?

Steve

PS: I would have taken a stab at fixing the issue and issuing a pull request, but version 0.7-SNAPSHOT always fails, reporting "could not find method changelogs() for arguments..." when I try to run it, and that error was beyond my limited Gradle expertise to fix.

I have the same problem. This is a real problem for us because after that, our Sphinx Indexer runs and fills the screen so you don't even see it visually unless you scroll up.

Same problem here

This is now fixed in release 1.0.0