Spring cloud Spring云契约:Stubrunner存储库根:从maven设置获取凭据
使用Spring cloud Spring云契约:Stubrunner存储库根:从maven设置获取凭据,spring-cloud,spring-cloud-contract,Spring Cloud,Spring Cloud Contract,使用autoconfiguresubrunner时,我希望将repositoryRoot的凭据存储在Maven的settings.xml中,并在代码中仅指定存储库URI(或别名) SpringCloudContracts/AutoConfigureSubrunner是否有办法从Maven的设置中提取这些凭证 我可以将uri+凭据作为环境变量提供STUBRUNNER\u REPOSITORY\u ROOT,但我仍然需要在其中显式设置凭据,并且在我的配置中,我无法运行任意代码来提供值,因此,我无法从
autoconfiguresubrunner
时,我希望将repositoryRoot
的凭据存储在Maven的settings.xml
中,并在代码中仅指定存储库URI(或别名)
SpringCloudContracts/AutoConfigureSubrunner
是否有办法从Maven的设置中提取这些凭证
我可以将uri+凭据作为环境变量提供
STUBRUNNER\u REPOSITORY\u ROOT
,但我仍然需要在其中显式设置凭据,并且在我的配置中,我无法运行任意代码来提供值,因此,我无法从设置中提取凭据。只需设置stubrunner.server id
以匹配settings.xml
中的id
。您可以在此处查看更多选项扩展Marcin的答案:
- 使用
指定存储库的URI,而不使用凭据。实际上,这里可能支持多个URI,逗号分隔repositoryRoot
- 使用
属性从stubrunner.server id
指定具有相关凭据的settings.xml
条目。最多支持一个这样的值server
- 将此依赖项添加到项目中(否则在运行时会缺少一些类):
org.eclipse.sisu
org.eclipse.sisu.plexus
0.3.4
试验
<dependency>
<groupId>org.eclipse.sisu</groupId>
<artifactId>org.eclipse.sisu.plexus</artifactId>
<version>0.3.4</version>
<scope>test</scope>
</dependency>