# pact-jvm

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 Pact Maven Plugin configuration is <plugin> <groupId></groupId> <artifactId>maven</artifactId> <version>4.2.19</version> <configuration> <pactBrokerUrl>${}</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<pactbrokerurl>${token}. But i am getting error such as [Error] Response from Pact Broker was not in JSON format: 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 Currently I am not enabling branches. Could you please share what is the mvn command for publish pacts when using version ?

Matt ( / 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?

Rejeesh Gangadharan

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