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

Verification results are not published to Pact Broker for maven project #538

Closed
Peikun0218 opened this issue Sep 15, 2017 · 9 comments
Closed

Comments

@Peikun0218
Copy link

Peikun0218 commented Sep 15, 2017

Hi, I updated the pact to version 3.5.5 for our Gradle project, and the verification results are sent back to pact broker successfully. However, it seems that this feature is not working on Maven project.
Do I need to do extra configuration on our project to be able to have the function?
Could you please provide more information in your documentation?

Thanks :)

@uglyog uglyog added the question label Oct 2, 2017
@uglyog
Copy link
Member

uglyog commented Oct 2, 2017

It should be automatic if you are loading the pacts from the pact broker. Can you run the verification with debug level logging enabled?

@Peikun0218
Copy link
Author

Yes, I can run the verification in debug mode, and I added the <pact.verifier.publishResults>true</pact.verifier.publishResults> into our configuration block. But the Last Verified value is still not sent to Pact Broker.
Is there a specific value that I should look for in the debug mode if the Last Verified value is returned?

@uglyog
Copy link
Member

uglyog commented Oct 10, 2017

I just helped another person with this problem (but with Gradle), and their issue is they has configured the verifier to load the pact from a URL (to the pact in the broker) instead of configuring it just to query the broker.

Check that you have configured a <pactBrokerUrl>http://pact-broker.....</pactBrokerUrl> or a <pactBroker> element and not a <pactUrl>

@Peikun0218
Copy link
Author

Thanks!!! It works. The problem is that we did not put the <pactBrokerUrl> in the right place.

Our <pactBrokerUrl> used to sit outside of the <serviceProviders>. After we move it into the <serviceProviders> to replace the <pactUrl>, the verification results are picked up by Pact broker successfully.
Thanks for your help :)

@uglyog
Copy link
Member

uglyog commented Oct 10, 2017

You're welcome.

But I agree it is confusing. The <pactBrokerUrl> outside is for publishing pacts.

@uglyog
Copy link
Member

uglyog commented Oct 10, 2017

I'm opening this again to track fixing up the confusing configuration tags.

@uglyog uglyog reopened this Oct 10, 2017
@Peikun0218
Copy link
Author

I clicked the wrong button and closed this question by accident. Anyway thanks! :)

Yes. I realised it just now.

@LucasAndersson
Copy link

LucasAndersson commented Oct 25, 2017

I'm having the same problem. The plugin seems to have no issues finding and verifying pacts but "Last verified" is never updated in the broker. I'm running the mvn pact:verify goal and my pom looks like this:

<build>
        <plugins>
            <plugin>
                <groupId>au.com.dius</groupId>
                <artifactId>pact-jvm-provider-maven_2.11</artifactId>
                <version>3.3.8</version>
                <configuration>
                    <serviceProviders>
                        <serviceProvider>
                            <name>customerportalapi</name>
                            <pactBrokerUrl>http://localhost</pactBrokerUrl>
                        </serviceProvider>
                    </serviceProviders>
                </configuration>
            </plugin>
        </plugins>
</build>

@uglyog
Copy link
Member

uglyog commented Oct 26, 2017

@LucasAndersson you need to run the latest version of the Maven plugin.

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