<dependency>
+<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<scope>test</scope>
@@ -2973,6 +2975,39 @@ dependencies {
diff --git a/1.0.x/spring-cloud-contract.html b/1.0.x/spring-cloud-contract.html index 1d07d39584..1c7fecfe53 100644 --- a/1.0.x/spring-cloud-contract.html +++ b/1.0.x/spring-cloud-contract.html @@ -571,6 +571,7 @@ $(addBlockSwitches);
<dependency>
+<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<scope>test</scope>
@@ -2973,6 +2975,39 @@ dependencies {
By default Rest Assured 2.x is added to the classpath. However in order to give the users the +opportunity to use Rest Assured 3.x it’s enough to add it to the plugins classpath.
+buildscript {
+ repositories {
+ mavenCentral()
+ }
+ dependencies {
+ classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}"
+ classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${verifier_version}"
+ classpath "io.rest-assured:rest-assured:3.0.2"
+ classpath "io.rest-assured:spring-mock-mvc:3.0.2"
+ }
+}
+
+depenendencies {
+ // all dependencies
+ // you can exclude rest-assured from spring-cloud-contract-verifier
+ testCompile "io.rest-assured:rest-assured:3.0.2"
+ testCompile "io.rest-assured:spring-mock-mvc:3.0.2"
+}
+That way the plugin will automatically see that Rest Assured 3.x is present on the classpath +and will modify the imports accordingly.
+Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:
@@ -3341,6 +3376,66 @@ class LoanApplicationServiceSpec extends Specification {You can read more in the Spring Cloud Contract Maven Plugin Docs
By default Rest Assured 2.x is added to the classpath. However in order to give the users the +opportunity to use Rest Assured 3.x it’s enough to add it to the plugins classpath.
+<plugin>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-contract-maven-plugin</artifactId>
+ <version>${spring-cloud-contract.version}</version>
+ <extensions>true</extensions>
+ <configuration>
+ <packageWithBaseClasses>com.example</packageWithBaseClasses>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.cloud</groupId>
+ <artifactId>spring-cloud-contract-verifier</artifactId>
+ <version>${spring-cloud-contract.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <version>3.0.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>spring-mock-mvc</artifactId>
+ <version>3.0.2</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+</plugin>
+
+<dependencies>
+ <!-- all dependencies -->
+ <!-- you can exclude rest-assured from spring-cloud-contract-verifier -->
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>rest-assured</artifactId>
+ <version>3.0.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.rest-assured</groupId>
+ <artifactId>spring-mock-mvc</artifactId>
+ <version>3.0.2</version>
+ <scope>test</scope>
+ </dependency>
+</dependencies>
+That way the plugin will automatically see that Rest Assured 3.x is present on the classpath +and will modify the imports accordingly.
+For Snapshot / Milestone versions you have to add the following section to your pom.xml