Liquibase gradle plugin doesn't seem to work in IntelliJ

1.1k Views Asked by At

I'm trying to integrate Liquibase to my company's application.

Our system uses Gradle as the build tool. I'm pretty new to Gradle.

I followed the following tutorial.

https://dzone.com/articles/managing-your-database-with-liquibase-and-gradle

I added the following to my build.gradle file.

def changeLog = "dev/samplechangelog.h2.sql"

task ('dev') {
    doLast {
        println "executing dev"
        liquibase {
            activities {
                main {
                    changeLogFile changeLog
                    url 'jdbc:postgresql://some_url:5432/postgres?currentSchema=schema_name'
                    username 'postgres'
                    password 'some_password'
                }
                runList = main
            }
        }
    }
}

And added the dependencies as in the tutorial.

After I build the project, I can see the Gradle task 'dev' like below.

enter image description here

The tutorial says to run gradle task dev update to run the gradle task.

But I think I should be able to do the same thing by double clicking the 'dev' task in the the 'Gradle' tab as in the above picture.

I put the update as an argument like below.

enter image description here

After I double click the Gradle task 'dev' I get the following output.

enter image description here

Even though it says the Build is successful, it's not. The databasechangelog table is not updated.

I can configm that the liquibase.properties file has the correct properties because I run liquibase via the terminal it updates in the same DB.

Does anyone have any ideas why this happens?

0

There are 0 best solutions below