What is Pact Publish mvn command for Maven Pact li...
# pact-jvm
r
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
Hi Rajeesh, a 401 indicates the authentication was incorrect. Are you should you have the correct details?
r
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?