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

gradle pactVerify failed (Task with path testClasses not found)

Open vinogradoff opened this issue 8 years ago • 3 comments

build.gradle

plugins {
  id "au.com.dius.pact" version "3.2.11"
}

pact {
    serviceProviders {
        providerSales {
            protocol = 'http'
            host = 'localhost'
            port = 5006
            path = '/lookupservice'

            hasPactsWith('manyConsumers') {
                pactFileLocation = file('pacts')
            }
        }
    }
}

One pact file is saved under ./pacts/

PS C:\Users\avinogradov> gradle pactVerify

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':pactVerify_providerSales'.
> Task with path 'testClasses' not found in root project 'avinogradov'.

What test classes? I though verification can be run against running provider with just pact file, can't it?

vinogradoff avatar Sep 28 '17 10:09 vinogradoff

You are correct, except for verifying messages the test class path is used. I'll put a change in to only add the testClasses if it exists in the project.

In the mean time, just add the java plugin to your build.gradle.

uglyog avatar Oct 05 '17 22:10 uglyog

Hi @uglyog , I met an issue recently.I added the spring dev tools plugin into my project. And when I run pactVerify task it will run the testClasses task. after testClassed finished, it will trigger the dev tools to restart the application which caused the pactVerify fail.

pei-wang avatar Dec 29 '17 08:12 pei-wang

@pei-wang could you include the error and stack trace?

uglyog avatar Jan 15 '18 00:01 uglyog