0

I can do this using the following pom entry:

        <plugin>
            <groupId>au.com.dius.pact.provider</groupId>
            <artifactId>maven</artifactId>
            <version>4.1.17</version>
            <configuration>
                <pactBrokerUrl>https://akbank.pactflow.io</pactBrokerUrl>
                <pactBrokerToken>MyToken</pactBrokerToken>
            </configuration>
        </plugin>

However I don't remember where I found this sample and not sure if this is the correct way because the groupid of the maven plugin ends with ".provider".

The documentation is very limited regarding to this topic. Please advise if what I'm doing is correct.

Cagin Uludamar
  • 372
  • 1
  • 3
  • 16
  • See https://github.com/pact-foundation/pact-jvm/tree/master/consumer/junit – Gaël J Apr 06 '23 at 19:44
  • @Gael it is the same as the documentation link I provided. The only thing it says about using the broker is: "If you use Gradle, you can use the pact Gradle plugin to publish your pact files." I'm using maven and need some sample code. – Cagin Uludamar Apr 07 '23 at 05:20
  • Recommended way is to use Pact CLI to publish pact files I believe. Even though it's surprising there's no maven plugin to do it I admit. – Gaël J Apr 07 '23 at 05:52

1 Answers1

0

OK it is in Pact Maven + Springboot + JUnit5 workshop, under Step 11 - Using a Pact Broker title.

<build>
  <plugins>
      ...
      <plugin>
          <groupId>au.com.dius.pact.provider</groupId>
          <artifactId>maven</artifactId>
          <version>4.1.17</version>
          <configuration>
            <pactBrokerUrl>http://localhost:9292</pactBrokerUrl>
            <pactBrokerUsername>pact_workshop</pactBrokerUsername>
            <pactBrokerPassword>pact_workshop</pactBrokerPassword>
          </configuration>
      </plugin>
  </plugins>
</build>
Cagin Uludamar
  • 372
  • 1
  • 3
  • 16