如何将消费者合同上传至官方Pact Broker

huangapple go评论94阅读模式
英文:

How to upload consumer contract to official Pact Broker

问题

以下是代码部分的中文翻译:

我可以使用以下的POM条目来实现这个:

<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>

然而,我不记得我在哪里找到这个示例,也不确定这是否是正确的方式,因为maven插件的groupid以“.provider”结尾。

[文档][1] 在这个主题上非常有限。请告诉我我是否做得对。

[1]: https://docs.pact.io/implementation_guides/jvm/consumer/junit#forcing-pact-files-to-be-overwritten-365
英文:

I can do this using the following pom entry:

		&lt;plugin&gt;
			&lt;groupId&gt;au.com.dius.pact.provider&lt;/groupId&gt;
			&lt;artifactId&gt;maven&lt;/artifactId&gt;
			&lt;version&gt;4.1.17&lt;/version&gt;
			&lt;configuration&gt;
				&lt;pactBrokerUrl&gt;https://akbank.pactflow.io&lt;/pactBrokerUrl&gt;
				&lt;pactBrokerToken&gt;MyToken&lt;/pactBrokerToken&gt;
			&lt;/configuration&gt;
		&lt;/plugin&gt;

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.

答案1

得分: 0

&lt;build&gt;
  &lt;plugins&gt;
      ...
      &lt;plugin&gt;
          &lt;groupId&gt;au.com.dius.pact.provider&lt;/groupId&gt;
          &lt;artifactId&gt;maven&lt;/artifactId&gt;
          &lt;version&gt;4.1.17&lt;/version&gt;
          &lt;configuration&gt;
            &lt;pactBrokerUrl&gt;http://localhost:9292&lt;/pactBrokerUrl&gt;
            &lt;pactBrokerUsername&gt;pact_workshop&lt;/pactBrokerUsername&gt;
            &lt;pactBrokerPassword&gt;pact_workshop&lt;/pactBrokerPassword&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/build&gt;
英文:

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

&lt;build&gt;
  &lt;plugins&gt;
      ...
      &lt;plugin&gt;
          &lt;groupId&gt;au.com.dius.pact.provider&lt;/groupId&gt;
          &lt;artifactId&gt;maven&lt;/artifactId&gt;
          &lt;version&gt;4.1.17&lt;/version&gt;
          &lt;configuration&gt;
            &lt;pactBrokerUrl&gt;http://localhost:9292&lt;/pactBrokerUrl&gt;
            &lt;pactBrokerUsername&gt;pact_workshop&lt;/pactBrokerUsername&gt;
            &lt;pactBrokerPassword&gt;pact_workshop&lt;/pactBrokerPassword&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  &lt;/plugins&gt;
&lt;/build&gt;

huangapple
  • 本文由 发表于 2023年4月6日 20:50:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949737.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定