This documentation takes you through the Spring Cloud Contract Workshops by asking you to complete a series of tasks that teach you both basic and more advanced concepts behind Consumer Driven Contracts in general and Spring Cloud Contract in particular.


The repository mostly consists of pairs of producer and consumer applications that show different use cases of Spring Cloud Contract. The initial state of the repository is such that all the examples are working and the tests are passing. In order for you to prepare the repository so that it has only the basic pieces of code ready for use, run the following Gradle command:

$ git clone
$ cd spring-cloud-contract-samples
$ ./gradlew prepareForWorkshops

The preceding commands removes most of the code, contracts, and project setup details, so that you can start the workshops.

Whenever you're lost, do not worry. At any time, you can check what the contents in the master branch where all of the examples are ready and working.
You must have Maven installed. Check out the website on how to download and install Maven.

Generating the documentation

To generate the documentation, call the Gradle task, as shown below:

$ git clone
$ cd spring-cloud-contract-samples
$ ./gradlew generateDocumentation


The following resources may help you learn about Spring Cloud Contracts:

Adib Saikali’s Introduction to Consumer Driven Contracts



Introduction to Spring Cloud Contract