liquibase / liquibase-gradle-plugin

A Gradle plugin for Liquibase
Other
197 stars 57 forks source link

missing_annotation in Gradle 7.2 #110

Closed kenjiru closed 1 year ago

kenjiru commented 1 year ago

Here's my build.gradle.kts file

plugins {
    id("org.liquibase.gradle") version "2.0.2"
}

dependencies {
    implementation("org.liquibase:liquibase-core")
    implementation("org.liquibase:liquibase-gradle-plugin:2.1.1")

    liquibaseRuntime("org.liquibase:liquibase-core")
    liquibaseRuntime("org.liquibase.ext:liquibase-hibernate")
    liquibaseRuntime("org.postgresql:postgresql")
    liquibaseRuntime("org.yaml:snakeyaml:1.33")
    liquibaseRuntime("ch.qos.logback:logback-core:1.2.3")
    liquibaseRuntime("ch.qos.logback:logback-classic:1.2.3")
}

liquibase {
    activities.register("main") {
        this.arguments = mapOf(
            "logLevel" to "info",
            "changeLogFile" to "src/main/resources/db/changelog.yaml",
            "url" to "jdbc:postgresql://localhost:5432/foo",
            "username" to "postgres",
            "password" to "postgres",
            "driver" to "org.postgresql.Driver",
        )
    }
    runList = "main"
}

But running commands doesn't seems to work:

./gradlew rollbackCount -PliquibaseCommandValue=1
> Task :rollbackCount FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':rollbackCount' (type 'LiquibaseTask').
  - In plugin 'org.liquibase.gradle' type 'org.liquibase.gradle.LiquibaseTask' property 'command' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

    Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
  - In plugin 'org.liquibase.gradle' type 'org.liquibase.gradle.LiquibaseTask' property 'requiresValue' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.

    Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_annotation for more details about this problem.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 798ms
1 actionable task: 1 executed

Any ideas how to fix this would be appreciated!

stevesaliman commented 1 year ago

Fixed in 2.2.0