https://pact.io logo
#pact-jvm
Title
# pact-jvm
r

Rejeesh Gangadharan

06/13/2022, 8:03 AM
What is Pact Publish mvn command for Maven Pact library 4.1.33/4.2.19/4.3.4? Looks like it needs this https://github.com/pact-foundation/pact_broker/blob/master/lib/pact_broker/doc/views/index/publish-contracts.markdown. Pact Maven Plugin configuration is <plugin> <groupId>au.com.dius.pact.provider</groupId> <artifactId>maven</artifactId> <version>4.2.19</version> <configuration> <pactBrokerUrl>${pact.broker.url}</pactBrokerUrl> <pactBrokerToken>${pact.pactbroker.token}</pactBrokerToken> <latest>true</latest> <projectVersion>${pact.consumer.version}</projectVersion> <tags>${pact.tag}</tags> </configuration> </plugin> Currently mvn command I am using is "mvn pact:publish -Dpact.consumer.version=<Git Commit> -Dpact.tags=feature-XXX _Dpact.broker.url=<pactbrokerurl> -Dpact.broker.token=${token}. But i am getting error such as [Error] Response from Pact Broker was not in JSON format: au.com.dius.pact.core.json.JsonException: Invalid JSON (1:2), found unexpected character 'U' Failed - Request to path 'https://pactbrokerurl/contracts/publish' failed with response 'HTTP/1.1 401 Unauthorized' But the same mvn command works fine with plugin version au.com.dius.pact.providermaven4.2.9. Currently I am not enabling branches. Could you please share what is the mvn command for publish pacts when using version au.com.dius.pact.providermaven4.2.19 ?
m

Matt (pactflow.io / pact-js / pact-go)

06/13/2022, 10:32 AM
Hi Rajeesh, a 401 indicates the authentication was incorrect. Are you should you have the correct details?
r

Rejeesh Gangadharan

06/13/2022, 10:48 AM
The same mvn command is working fine for plugin version au.com.dius.pact.providermaven4.2.9 but we are getting error for au.com.dius.pact.providermaven4.2.19. We are using Pactflow version 1.17.2. Do we need to enable any environment variables setup for "all-in-one" pact publish endpoint?
2 Views