pact-jvm icon indicating copy to clipboard operation
pact-jvm copied to clipboard

"Your project is misconfigured" error when publishing results of provider verification with Gradle and Kotlin

Open johnsgp opened this issue 2 years ago • 0 comments

When I run

gradle pactVerify -Ppact.verifier.publishResults=true

I am getting an error:

Your project is misconfigured, was expecting a 'pact' configuration in the build, but got a String with value '' instead. Make sure there is no property that is overriding 'pact'.

The pact verifies successfully without -Ppact.verify.publishResults=true on the command line.

I am using Gradle 6.8.3 with Java 11 and Kotlin 1.4.20 on Windows 10 Professional. (I have also tried Gradle 7.1 and Kotlin 1.4.31)

I have reviewed the documentation and tried to find related issues without success.

My Gradle build file uses the Kotlin DSL and I've tried Groovy DSL as well with the same result. This is what it looks like (with URLs elided):

plugins {
    id("au.com.dius.pact") version "4.2.14"
}

pact {
    broker {
        pactBrokerUrl = "https://..."
    }
    reports {
        defaultReports()
    }
    serviceProviders {
        create("provider") {
            protocol = "http"
            host = "localhost"
            port = 8081
            path = "/"
            version = "test"

            hasPactWith("consumer") {
                pactSource = url("https://...")
            }
        }
    }
}

johnsgp avatar Oct 13 '21 18:10 johnsgp