tlberglund/gradle-liquibase-plugin

namepace the liquibase tasks

Closed this issue · 4 comments

I feel like some of the liquibase tasks have common task names (update for example) and it would be useful to have them namespaced.

gradle update

to

gradle db-update

The plugin was designed to be a thin wrapper around Liquibase itself, so we create tasks that mimic the liquibase commands themselves. Liquibase has an "update" command, so the plugin has an "update" task. I think it makes it easier for users to figure out what to do from the Liquibase documentation.

I also think it can lead to problems if any other plugin tries to use any of these tasks. I'll look into adding a configuration option that prefixes all the tasks with "liquibase". That way, users who are used to using gradle update can continue to use it, but users with a conflict can use gradle liquibaseUpdate.

I wasn't able to use a configuration option because the plugin is applied, and tasks are created before the configuration is applied.

So I added a build property that you can use to specify any prefix you need to make Liquibase tasks unique. For example, if you invoke Gradle with -PliquibaseTaskPrefix=liquibase, or you put liquibaseTaskPrefix=liquibase in gradle.properties then the plugin will create tasks named liquibaseUpdate, liquibaseTag, etc.

This change is now available in the Maven Snapshot repository. I hope to have a production release in the next couple of weeks or so.

Thank you for the suggestion, I think this will help out a lot of people, and make this plugin more robust going forward

Steve

I just tested the 1.0.1-SNAPSHOT release because I had a task name conflict and I got this java version error (I'm running on Oracle Linux with JDK1.7u72, Gradle 2.2.1):
Execution failed for task ':liquibaseUpdate'. net/saliman/gradle/liquibase/Main : Unsupported major.minor version 52.0
The 1.0.0 release works fine for the same versions.

I switch java versions a lot when I test things, and must have uploaded the last snapshot after compiling with Java 8.

I just recompiled and uploaded a new snapshot with explicit support for Java 1.5 and above. Things should be working now.