diff --git a/docs/src/main/asciidoc/gradle-project.adoc b/docs/src/main/asciidoc/gradle-project.adoc index e12a4b8e1d..60b91f681d 100644 --- a/docs/src/main/asciidoc/gradle-project.adoc +++ b/docs/src/main/asciidoc/gradle-project.adoc @@ -34,7 +34,8 @@ documnetation for more information] To add a Gradle plugin with dependencies, you can use code similar to the following: ==== -[source,groovy,indent=0] +[source,groovy,indent=0,subs="verbatim,attributes",role="primary"] +.Plugin DSL ---- buildscript { repositories { @@ -55,6 +56,39 @@ dependencyManagement { } } +dependencies { + testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}" + // example with adding Spock core and Spock Spring + testCompile "org.spockframework:spock-core:${spockVersion}" + testCompile "org.spockframework:spock-spring:${spockVersion}" + testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier' +} +---- + +[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"] +.Legacy Plugin Application +---- +buildscript { + repositories { + mavenCentral() + } + dependencies { + classpath "org.springframework.boot:spring-boot-gradle-plugin:${springboot_version}" + } +} + +apply plugin: 'groovy' + +plugins { + id "org.springframework.cloud.contract" version "${GAVerifierVersion}" +} + +dependencyManagement { + imports { + mavenBom "org.springframework.cloud:spring-cloud-contract-dependencies:${verifier_version}" + } +} + dependencies { testCompile "org.codehaus.groovy:groovy-all:${groovyVersion}" // example with adding Spock core and Spock Spring @@ -65,6 +99,8 @@ dependencies { ---- ==== +IMPORTANT: The Plugin DSL option will only work for GA (General Availability) releases (i.e. `2.2.0.RELEASE` etc.). + [[gradle-and-rest-assured]] == Gradle and Rest Assured 2.0