Fork me on GitHub

Usage

Converting Spring Cloud Contract DSL into WireMock stub mappings

mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:convert

or shortly [1]

mvn spring-cloud-contract:convert

For more information please go to the Spring Cloud Contract Wiki or Plugin Documentation Site.

Spring Cloud Contract Stub Runner

Run stubs mappings from current directory:

mvn org.springframework.cloud:spring-cloud-contract-maven-plugin:run

or shortly [1]

mvn spring-cloud-contract:run

Running stubs from repository

mvn spring-cloud-contract:run -Dstubs="org.springframework:gs-rest-service"

where org.springframework:gs-rest-service is artifact with stubs classifier contains WireMock mappings.

In order for the goal to be executed correctly, target/stubs subdirectory should be added in the directory from which the command will be executed.

Project configuration

                        <plugin>
                                <groupId>org.springframework.cloud</groupId>
                                <artifactId>spring-cloud-contract-maven-plugin</artifactId>
                                <version>${spring-cloud-verifier-plugin.version}</version>
                                <extensions>true</extensions>
                                <configuration>
                                        <baseClassForTests>hello.BaseAccurest</baseClassForTests>
                                </configuration>
                        </plugin>

1. Additional configuration inside ~/.m2/settings.xml is required: <pluginGroups><pluginGroup>org.springframework.cloud</pluginGroup></pluginGroups>.