Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pact.provider maven plugin v4.1.0] mvn pact:verify command cannot find 'pactFile' in class au.com.dius.pact.provider.maven.Consumer #1203

Open
wubin28 opened this issue Sep 2, 2020 · 3 comments

Comments

@wubin28
Copy link

wubin28 commented Sep 2, 2020

I added the maven plugin to verify a provider according to the document. But after running "mvn pact:verify" command, I got the following error:

[ERROR] Failed to execute goal au.com.dius.pact.provider:maven:4.1.0:verify (default-cli) on project pact-ec-review-service: Unable to parse configuration of mojo au.com.dius.pact.provider:maven:4.1.0:verify for parameter pactFile: Cannot find 'pactFile' in class au.com.dius.pact.provider.maven.Consumer.

Here is the plugin I added to the pom.xml.

      <plugin>
        <groupId>au.com.dius.pact.provider</groupId>
        <artifactId>maven</artifactId>
        <version>4.1.0</version>
        <configuration>
          <serviceProviders>
            <serviceProvider>
              <name>review_service</name>
              <protocol>http</protocol>
              <host>localhost</host>
              <port>8080</port>
              <path>/</path>
              <consumers>
                <!-- Again, you can define as many consumers for each provider as you need, but each must have a unique name -->
                <consumer>
                  <name>es_app</name>
                  <!--  currently supports a file path using pactFile or a URL using pactUrl -->
                  <pactFile>/Users/binwu/OOR/katas/pact-ec-review-service/src/test/resources/ec_app-review_service.json</pactFile>
                </consumer>
              </consumers>
            </serviceProvider>
          </serviceProviders>
        </configuration>
      </plugin>

@uglyog
Copy link
Member

uglyog commented Sep 5, 2020

It should be pactSource. The docs need to be corrected.

@ryanwilson-bv
Copy link

Hi there, I ran into the issue above and replaced pactFile with pactSource but then got the following error:

Execution default-cli of goal au.com.dius.pact.provider:maven:4.1.0:verify failed: You must specify the pact file to execute for consumer 'API' (use <pactFile> or <pactUrl>)

I have been able to use pactUrl to run provider tests but I want to test changes locally first before updating our pact-broker, so I need to pull in the pacts from a file.

@uglyog
Copy link
Member

uglyog commented Nov 28, 2020

Use the latest version: 4.1.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants