我在生产者项目的pom.xml中有spring-cloud-contract-maven-plugin。当我使用以下插件时,它不会将罐子安装到.m2存储库中。
我尝试添加多个版本的Spring-Cloud-Contract和2.0.2.Release似乎只能成功构建。
` <plugin>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>2.0.2.RELEASE</version>
<!--<executions>-->
<!--<execution>-->
<!--<goals>-->
<!--<goal>convert</goal>-->
<!--<goal>generateStubs</goal>-->
<!--<goal>generateTests</goal>-->
<!--</goals>-->
<!--</execution>-->
<!--</executions>-->
<extensions>true</extensions>
<configuration>
<packageWithBaseClasses>com.sam.fraud.fcm.fraudcase.gateway.test.contracts</packageWithBaseClasses>
</configuration>
</plugin>`
如果在POM中添加了上述插件,则.m2文件夹根本没有安装依赖项Locall,生成了存根,但是在目标文件夹中,.m2未更新
`[INFO] Installing com.sam.fraud.fcm:fraud-case-gateway-api:1.0.0-SNAPSHOT at end`
如果我删除插件或评论,我会得到以下内容,即安装&amp;工作正常,但我需要的目标不是生成的。
`[INFO] Installing C:UserssamFCM-forksfraud-case-gateway-contract-testsapipom.xml to C:Userssam.m2repositoryFCM2comsamfraudfcmfraud-case-gateway-api1.0.0-SNAPSHOTfraud-case-gateway-api-1.0.0-SNAPSHOT.pom`
我需要正确的插件,因为这与测试和软件包的基类一起使用。我也尝试了
`<baseClassForTests>
com.sam.fraud.fcm.fraudcase.gateway.test.contracts.RepreclientBase
</baseClassForTests>`
感谢Marcin,但看起来我想知道的是MVN插件插件版本,该版本并未在本地上传,我从2.5.4将版本从2.4降为2.4。
alsom无限异常与Spring Boot 2的WireMock-Servlet问题有关。使用javax-servlet-api:4.0.1
版本帮助我构建&amp;成功运行我的应用程序。