From 772e5196c60a8026ae1836e3a68a186c39f89224 Mon Sep 17 00:00:00 2001
From: buildmaster
First, add the common jar dependency as a test dependency. Because your contracts files are available on the test resources path, the common jar classes automatically become visible in your Groovy files. The following examples show how to test the dependency:
Maven. -
Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/pom.xml[tags=test_dep,indent=0]
+
<dependency> + <groupId>com.example</groupId> + <artifactId>beer-common</artifactId> + <version>${project.version}</version> + <scope>test</scope> +</dependency>
Gradle. -
Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/build.gradle[tags=test_dep,indent=0]+
testCompile("com.example:beer-common:0.0.1-SNAPSHOT")
Now, you must add the dependency for the plugin to reuse at runtime, as shown in the following example:
Maven.
<plugin>
diff --git a/1.2.x/single/spring-cloud-contract.html b/1.2.x/single/spring-cloud-contract.html
index 42d0f25dce..c4642131e8 100644
--- a/1.2.x/single/spring-cloud-contract.html
+++ b/1.2.x/single/spring-cloud-contract.html
@@ -4656,9 +4656,14 @@ maintain the static compatibility. Later in this document, you can see examples
to pass the dependency to your project.First, add the common jar dependency as a test dependency. Because your contracts files are available on the test resources path, the common jar classes automatically become visible in your Groovy files. The following examples show how to test the dependency:
Maven. -
Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/pom.xml[tags=test_dep,indent=0]
+
<dependency> + <groupId>com.example</groupId> + <artifactId>beer-common</artifactId> + <version>${project.version}</version> + <scope>test</scope> +</dependency>
Gradle. -
Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/build.gradle[tags=test_dep,indent=0]+
testCompile("com.example:beer-common:0.0.1-SNAPSHOT")
Now, you must add the dependency for the plugin to reuse at runtime, as shown in the following example:
Maven.
<plugin> diff --git a/1.2.x/spring-cloud-contract.xml b/1.2.x/spring-cloud-contract.xml index 99a356bf82..6ba2905860 100644 --- a/1.2.x/spring-cloud-contract.xml +++ b/1.2.x/spring-cloud-contract.xml @@ -7514,13 +7514,18 @@ visible in your Groovy files. The following examples show how to test the dependMaven - Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/pom.xml[tags=test_dep,indent=0] +<dependency> + <groupId>com.example</groupId> + <artifactId>beer-common</artifactId> + <version>${project.version}</version> + <scope>test</scope> +</dependency> Gradle - Unresolved directive in verifier_contract.adoc - include::https://raw.githubusercontent.com/spring-cloud-samples/spring-cloud-contract-samples/master/producer/build.gradle[tags=test_dep,indent=0] +testCompile("com.example:beer-common:0.0.1-SNAPSHOT")