diff --git a/docs/src/main/asciidoc/_project-features-contract.adoc b/docs/src/main/asciidoc/_project-features-contract.adoc index f966635efe..06dfd2d553 100644 --- a/docs/src/main/asciidoc/_project-features-contract.adoc +++ b/docs/src/main/asciidoc/_project-features-contract.adoc @@ -103,6 +103,63 @@ To get started with writing contracts in Kotlin you would need to start with a ( Just like the with the Java DSL you can put your contracts in any directory of your choice. The Maven and Gradle plugins will look at the `src/test/resources/contracts` directory by default. +You need to explicitly pass the the `spring-cloud-contract-spec-kotlin` dependency to your project plugin setup. + + +==== +[source,xml,indent=0,subs="verbatim,attributes",role="primary"] +.Maven +---- + + org.springframework.cloud + spring-cloud-contract-maven-plugin + ${spring-cloud-contract.version} + true + + + + + + org.springframework.cloud + spring-cloud-contract-spec-kotlin + ${spring-cloud-contract.version} + + + + + + + + org.springframework.cloud + spring-cloud-contract-spec-kotlin + test + + +---- + +[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"] +.Gradle +---- +buildscript { + repositories { + // ... + } + dependencies { + classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${scContractVersion}" + // remember to add this: + classpath "org.springframework.cloud:spring-cloud-contract-spec-kotlin:${scContractVersion}" + } +} + +dependencies { + // ... + + // Remember to add this for the DSL support in the IDE and on the consumer side + testImplementation "org.springframework.cloud:spring-cloud-contract-spec-kotlin" +} +---- +==== + IMPORTANT: Remember that, inside the Kotlin Script file, you have to provide the fully qualified name to the `ContractDSL` class. Generally you would use its contract function like this: `org.springframework.cloud.contract.spec.ContractDsl.contract { ... }`. You can also provide an import to the `contract` function (`import org.springframework.cloud.contract.spec.ContractDsl.Companion.contract`) and then call `contract { ... }`. diff --git a/docs/src/main/asciidoc/howto.adoc b/docs/src/main/asciidoc/howto.adoc index 9cfbb76ee1..d374a78ebb 100644 --- a/docs/src/main/asciidoc/howto.adoc +++ b/docs/src/main/asciidoc/howto.adoc @@ -841,7 +841,7 @@ set a `metaData` entry in the Pact file with the `sentTo` key equal to the desti === Pact Contract Spring Cloud Contract can read the Pact JSON definition. You can place the file in the -`src/test/resources/contracts` folder. The following example shows such a Pact contract: +`src/test/resources/contracts` folder. Remember to put the `spring-cloud-contract-pact` dependency to your classpath. The following example shows such a Pact contract: ==== [source,javascript,indent=0] diff --git a/scripts/fastBuild.sh b/scripts/fastBuild.sh index 5acf714f02..c01c9b8686 100755 --- a/scripts/fastBuild.sh +++ b/scripts/fastBuild.sh @@ -4,7 +4,7 @@ source common.sh || source scripts/common.sh || echo "No common.sh script found. set -e -[[ -z "${CORES}" ]] && CORES=1 +[[ -z "${CORES}" ]] && CORES=4 echo -e "\n\nRUNNING FAST BUILD (NO INTEGRATION TESTS) WITH [${CORES}] CORES\n\n" -./mvnw clean install -Pdocs,fast -T ${CORES} -Dinvoker.parallelThreads=${CORES} \ No newline at end of file +./mvnw clean install -Pdocs,fast -T ${CORES} -Dinvoker.parallelThreads=${CORES} diff --git a/specs/spring-cloud-contract-spec/pom.xml b/specs/spring-cloud-contract-spec/pom.xml index 57705e919d..266db46ff9 100644 --- a/specs/spring-cloud-contract-spec/pom.xml +++ b/specs/spring-cloud-contract-spec/pom.xml @@ -22,10 +22,6 @@ org.springframework.cloud spring-cloud-contract-spec-groovy - - org.springframework.cloud - spring-cloud-contract-spec-kotlin - org.spockframework spock-core