diff --git a/.travis.yml b/.travis.yml index b63ed069cf..7a80f5443e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ jdk: - oraclejdk8 install: ./gradlew assemble -s -script: ./gradlew check funcTest install -s --continue && jdk_switcher use oraclejdk8 && ./scripts/runTests.sh +script: ./gradlew check install -s --continue && jdk_switcher use oraclejdk8 && ./scripts/runTests.sh diff --git a/README.adoc b/README.adoc index 2796a76e7f..9bd94b36f0 100644 --- a/README.adoc +++ b/README.adoc @@ -157,6 +157,18 @@ Spring Cloud Contract Verifier stand out on the "market" of Consumer Driven Cont - Stub Runner functionality - the stubs are automatically downloaded at runtime from Nexus / Artifactory - Spring Cloud integration - no discovery service is needed for integration tests +== Links + +Here you can find interesting links related to Spring Cloud Contract Verifier: + +- https://github.com/Codearte/accurest[Spring Cloud Contract Verifier Github Repository] +- http://codearte.github.io/accurest[Spring Cloud Contract Verifier Documentation] +- http://codearte.github.io/accurest/deprecated[Accurest Legacy Documentation] +- https://codearte.github.io/accurest/#spring-cloud-contract-stub-runner[Spring Cloud Contract Stub Runner Documentation] +- http://codearte.github.io/accurest/#stub-runner-for-messaging[Spring Cloud Contract Stub Runner Messaging Documentation] +- https://gitter.im/Codearte/accurest[Spring Cloud Contract Verifier Gitter] +- https://github.com/Codearte/accurest-maven-plugin[Spring Cloud Contract Verifier Maven Plugin] + == Documentation You can read more about Spring Cloud Contract Verifier by reading the {documentation_url}[docs] diff --git a/docs/src/main/asciidoc/rest.adoc b/docs/src/main/asciidoc/rest.adoc index 6bf3c847dd..843d396ec6 100644 --- a/docs/src/main/asciidoc/rest.adoc +++ b/docs/src/main/asciidoc/rest.adoc @@ -42,7 +42,7 @@ Add the additional snapshot repository to your build.gradle to use snapshot vers repositories { (...) //Required only for SNAPSHOT versions - maven { url "https://oss.sonatype.org/content/repositories/snapshots" } + maven { url "https://repo.spring.io/plugins-snapshot-local" } } ---- @@ -91,6 +91,48 @@ Spring Cloud Contract Verifier will create test class `defaultBasePackage.MyServ Plugin registers itself to be invoked before `check` task. You have nothing to do as long as you want it to be part of your build process. If you just want to generate tests please invoke `generateContractTests` task. +==== Default setup + +Default Gradle Plugin setup creates the following Gradle part of the build (it's a pseudocode) + +[source,groovy,indent=0] +---- +contractVerifier { + targetFramework = 'JUNIT' + testMode = 'MockMvc' + generatedTestSourcesDir = project.file("${project.buildDir}/generated-test-sources/contracts") + contractsDslDir = "${project.rootDir}/src/test/resources/contracts" + basePackageForTests = 'org.springframework.cloud.contract.verifier.tests' + stubsOutputDir = project.file("${project.buildDir}/stubs") +} + +tasks.create(type: Jar, name: 'verifierStubsJar', dependsOn: 'generateWireMockClientStubs') { + baseName = project.name + classifier = contractVerifier.stubsSuffix + from contractVerifier.stubsOutputDir +} + +project.artifacts { + archives task +} + +tasks.create(type: Copy, name: 'copyContracts') { + from contractVerifier.contractsDslDir + into contractVerifier.stubsOutputDir +} + +verifierStubsJar.dependsOn 'copyContracts' + +publishing { + publications { + stubs(MavenPublication) { + artifactId project.name + artifact verifierStubsJar + } + } +} +---- + ==== Configure plugin To change default configuration just add `contractVerifier` snippet to your Gradle config diff --git a/docs/src/main/asciidoc/stubrunner.adoc b/docs/src/main/asciidoc/stubrunner.adoc index 3478146c9f..6ba4fb98f9 100644 --- a/docs/src/main/asciidoc/stubrunner.adoc +++ b/docs/src/main/asciidoc/stubrunner.adoc @@ -9,6 +9,19 @@ One of the issues that you could have encountered while using Spring Cloud Contr Copying the JSON files / setting the client side for messaging manually is out of the question. +=== Snapshot versions + +Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build: + +[source,groovy,indent=0] +---- +repositories { + (...) + //Required only for SNAPSHOT versions + maven { url "https://repo.spring.io/libs-snapshot-local" } +} +---- + === Publishing stubs as JARs The easiest approach would be to centralize the way stubs are kept. For example you can keep them as JARs in a Maven repository.