liquibase / liquibase-gradle-plugin

A Gradle plugin for Liquibase
Other
199 stars 59 forks source link

problem adding OutputEnablingLiquibaseRunner in liquibase block #52

Closed regrog closed 5 years ago

regrog commented 5 years ago

Hi, I'm trying to see some log/console during liquibase execution but I get this error adding mainClassName 'org.liquibase.gradle.OutputEnablingLiquibaseRunner':

Task :update FAILED liquibase-plugin: Running the 'myAct1' activity... Error: Could not find or load main class org.liquibase.gradle.OutputEnablingLiquibaseRunner

liquibase plugin 2.0.1 liquibase core 3.6.2 java 8

build.gradle

buildscript {
    repositories {...}
    dependencies {
        ...
        classpath "org.liquibase:liquibase-gradle-plugin:2.0.1"
    }
}
dependencies {
    liquibaseRuntime "org.postgresql:postgresql:${POSTGRESQL_VERS}"
    liquibaseRuntime "org.liquibase:liquibase-core:3.6.2"
    liquibaseRuntime "org.yaml:snakeyaml:1.23"
}
liquibase {
    activities {
        myAct1 {
            ...
        }
    }
    runList = liquibase_runList
    mainClassName 'org.liquibase.gradle.OutputEnablingLiquibaseRunner'
}

Am I doing something wrong?

stevesaliman commented 5 years ago

The OutputEnablingLiquibaseRunner is part of the plugin, so the plugin needs to be in the classpath use to run Liquibase as well as gradle's own classpath. Adding a liquibaseRuntime "org.liquibase:liquibase-gradle-plugin:2.0.1" dependency should do the trick.

I should probably clarify that in the README.

regrog commented 5 years ago

Great, now it's working!

I should probably clarify that in the README.

Yes!