首页 > 解决方案 > 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。任何指针?

标签: javaspring-bootspring-cloud-contract

解决方案


推荐阅读