mardi 7 mai 2019

The artifact was found in the local repository but you have explicitly stated that it should be downloaded from a remote one"

I have consumer project, which has spring cloud contract tests verifier,which needs to talk to the stubs jar in the remote repo. The setup for stubsMode: LOCAL works fine, but for remote it throws the following error.

Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.contract.stubrunner.BatchStubRunner]: Factory method 'batchStubRunner' threw exception; nested exception is java.lang.IllegalStateException: The artifact was found in the local repository but you have explicitly stated that it should be downloaded from a remote one at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622) ... 43 more Caused by: java.lang.IllegalStateException: The artifact was found in the local repository but you have explicitly stated that it should be downloaded from a remote one

Consumer Side remote code:

@RunWith(SpringRunner.class) @SpringBootTest(classes = FraudCaseGatewayRestClientConfig.class, webEnvironment = SpringBootTest.WebEnvironment.MOCK) @AutoConfigureStubRunner( repositoryRoot="https://nexus.com/nexus/content/repositories/sam-releases/com/sam/fraud/fcm/fraud-case-gateway-api/1.0.14-12/", ids = "com.sam.fraud.fcm:fraud-case-gateway-api:+:stubs:8083", stubsMode = StubRunnerProperties.StubsMode.REMOTE ) public class UpdateCaseContractClient {

pom.xml

<spring-cloud.version>Finchley.SR2</spring-cloud.version> <spring-cloud-contract.version>2.0.2.RELEASE</spring-cloud-contract-version>

I need to use REMOTE repoUrl for the consumer project to talk to the producer stub jar.

Aucun commentaire:

Enregistrer un commentaire