Closed mpssantos closed 2 years ago
Apparently, if more than 1 producers are defined on the contracts project, in the producer, it resolves only the contracts of the directory matching its groupid:artifact id. Is this correct?
Yeah I mean it will have to find the contracts for a particular producer in order to generate tests for that producer. Would you expect this to work in a different way?
Yes, this is the expected behavior. I was having issues setting up the project, but after i setup properly the producer, i noticed that it only download the contracts from the the directory that match the structure of its group-id and artifact-id.
Thank you very much for your support, and congratulations for you awesome job with this project. Thanks a mil.
I am working on a microservice architecture system. I would like to setup a common repository with all the contracts of our microservices, using a consumer driven approach. I am taking this sample as an example:
https://github.com/spring-cloud/spring-cloud-contract/tree/main/samples/standalone/contracts
No problems setting up a test on the consumer side.
But while setting up the producer to get the contracts, I realized that the
contracts-0.0.1-SNAPSHOT.jar
contains all the contacts of all producers in the contracts project. This sample project sample is simple and only contains one producer:com.example:server
.What happens when more producers contracts are added like
com.example:my-super-service
? From what i understood,contracts-0.0.1-SNAPSHOT.jar
will contain all the contracts for bothserver
andmy-super-service
applications.Does it make sense all producers get all universe of contracts by the means of this jar? How can we restrict the installed contracts to be to the service in question? for instance
com.example:my-super-service
only to see its respective contracts? Or this repo was tough to be on a per producer basis?What solution would you advise?
Thank you so much for your help