java - Spring Cloud Contract 问题从本地存储库中检索存根
问题描述
我正在尝试从我的客户端应用程序运行存根,但出现以下错误 -
原因:java.lang.IllegalArgumentException:对于 groupId [com.xx] artifactId [cdc-demo-server] 和分类器 [stubs] 版本未解析!发生以下异常 [org.eclipse.aether.transfer.MetadataNotFoundException: 找不到元数据 com.xx:cdc-demo-server/maven-metadata.xml 在本地 (C:\Users\xx\.m2\repository) ]
实际上,我使用的是跑步者无法识别的不同 m2 存储库。
我尝试使用repositoryRoot = "C:/m2_repo/"
in设置 m2 repo 路径@AutoConfigureStubRunner
并将 pom 更新为
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<maven.repo.local>${settings.localRepository}</maven.repo.local>
</systemPropertyVariables>
</configuration>
</plugin>
在我的仓库中,我可以看到一个文件maven-metadata-local.xml
以及存根 jar。任何指针?
解决方案
推荐阅读
- java - 有谁知道为什么我的快速排序算法在大型数据集 ex 上出现堆栈溢出错误。长度为 100,000 的数组?
- python - 为什么我的 Django 对象没有保存到数据库中?
- vb.net - 将缺少的分隔符添加到 .CSV 文件 Visual Basic vb.net
- javascript - 如何从随机生成的数组中排除某些值
- image - 更改图像通道会破坏图像吗?
- python - 如何修改此 Google Colab 以接受我自己的压缩文件,并在我自己的图像上运行模型?
- html - 单击时打开不同 div 的复选框
- python - 为什么 scipy.optimize.curve_fit() 在拟合函数中使用定义数量的参数时表现更好?
- reactjs - Typescript React:我是否必须为超类构造函数指定参数。那会是什么论据?
- javascript - 单击 [ Javascript ] 时更改所有 Divs 颜色