diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy index bedb2c3ebd..ed7741c47c 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/main/groovy/org/springframework/cloud/contract/verifier/plugin/SpringCloudContractVerifierGradlePlugin.groovy @@ -31,12 +31,6 @@ import org.gradle.jvm.tasks.Jar *
  • generate stubs
  • * * - * Also adds the necessary {@code testCompile} dependencies - * - * - * * @author Jakub Kubrynski, codearte.io * @author Marcin Grzejszczak * @@ -70,7 +64,6 @@ class SpringCloudContractVerifierGradlePlugin implements Plugin { createGenerateTestsTask(extension, copyContracts) Task clientTask = createAndConfigureGenerateClientStubsFromDslTask(extension, copyContracts) createAndConfigureGenerateWireMockClientStubsFromDslTask(extension, clientTask) - addProjectDependencies(project) addIdeaTestSources(project, extension) } @@ -88,10 +81,6 @@ class SpringCloudContractVerifierGradlePlugin implements Plugin { } } - private void addProjectDependencies(Project project) { - project.dependencies.add("testCompile", "com.toomuchcoding.jsonassert:jsonassert:0.4.7") - } - private void setConfigurationDefaults(ContractVerifierExtension extension) { extension.with { generatedTestSourcesDir = generatedTestSourcesDir ?: project.file("${project.buildDir}/generated-test-sources/contracts") diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy index fab7933809..0b6ca2514f 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/groovy/org/springframework/cloud/contract/verifier/plugin/ContractVerifierSpec.groovy @@ -109,16 +109,6 @@ class ContractVerifierSpec extends Specification { publications.findByName("stubs") != null } - def "should add jsonassert as a testCompile dependency"() { - given: - project.plugins.apply(SpringCloudContractVerifierGradlePlugin) - - expect: - project.configurations.testCompile.dependencies.find { - it.group == "com.toomuchcoding.jsonassert" && it.name == "jsonassert" - } != null - } - def "should compile"() { given: ContractVerifierExtension extension = new ContractVerifierExtension() diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle index ea8b3ef37d..7dac93008a 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/build.gradle @@ -21,12 +21,13 @@ repositories { } dependencies { - compile "org.springframework:spring-web:$springVersion" - compile "org.springframework:spring-context-support:$springVersion" + compile "org.springframework:spring-web" + compile "org.springframework:spring-context-support" compile "org.codehaus.groovy:groovy-all:2.4.5" compile 'com.jayway.jsonpath:json-path-assert:2.2.0' - testCompile "com.github.tomakehurst:wiremock:2.5.1" + testCompile "com.github.tomakehurst:wiremock:${wiremockVersion}" + testCompile "com.toomuchcoding.jsonassert:jsonassert:${jsonAssertVersion}" testCompile "org.spockframework:spock-spring:1.0-groovy-2.4" testCompile "com.jayway.restassured:rest-assured:$restAssuredVersion" testCompile "com.jayway.restassured:spring-mock-mvc:$restAssuredVersion" diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties index 2138cee1c0..428bf726fe 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/bootSimple/gradle.properties @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # +wiremockVersion=2.5.1 +jsonAssertVersion=0.4.8 -groupId=org.springframework.cloud.testprojects -springBootVersion=1.4.3.RELEASE \ No newline at end of file diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle index a4a2979ab4..ad43aab9c9 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/build.gradle @@ -31,7 +31,6 @@ allprojects { ext { restAssuredVersion = '2.5.0' spockVersion = '1.0-groovy-2.4' - wiremockVersion = '2.5.1' contractVerifierStubsBaseDirectory = 'src/test/resources/stubs' } @@ -48,7 +47,8 @@ subprojects { testCompile 'org.codehaus.groovy:groovy-all:2.4.5' testCompile "org.spockframework:spock-core:$spockVersion" testCompile 'junit:junit:4.12' - testCompile "com.github.tomakehurst:wiremock:$wiremockVersion" + testCompile "com.github.tomakehurst:wiremock:${wiremockVersion}" + testCompile "com.toomuchcoding.jsonassert:jsonassert:${jsonAssertVersion}" } } diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties new file mode 100644 index 0000000000..428bf726fe --- /dev/null +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleJerseyProject/gradle.properties @@ -0,0 +1,19 @@ +# +# Copyright 2013-2017 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +wiremockVersion=2.5.1 +jsonAssertVersion=0.4.8 + + diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle index 842ad5f217..44440b4339 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/build.gradle @@ -27,7 +27,6 @@ buildscript { ext { restAssuredVersion = '2.5.0' spockVersion = '1.0-groovy-2.4' - wiremockVersion = '2.5.1' contractVerifierStubsBaseDirectory = 'src/test/resources/stubs' } @@ -46,7 +45,8 @@ subprojects { testCompile "org.codehaus.groovy:groovy-all:2.4.5" testCompile "org.spockframework:spock-core:$spockVersion" testCompile("junit:junit:4.12") - testCompile "com.github.tomakehurst:wiremock:$wiremockVersion" + testCompile "com.github.tomakehurst:wiremock:${wiremockVersion}" + testCompile "com.toomuchcoding.jsonassert:jsonassert:${jsonAssertVersion}" } } diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties new file mode 100644 index 0000000000..428bf726fe --- /dev/null +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/sampleProject/gradle.properties @@ -0,0 +1,19 @@ +# +# Copyright 2013-2017 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +wiremockVersion=2.5.1 +jsonAssertVersion=0.4.8 + + diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle index fbfc517fcb..662dc6b394 100644 --- a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/build.gradle @@ -27,7 +27,6 @@ buildscript { ext { restAssuredVersion = '2.5.0' spockVersion = '1.0-groovy-2.4' - wiremockVersion = '2.5.1' contractVerifierStubsBaseDirectory = 'src/test/resources/stubs' } @@ -47,7 +46,8 @@ subprojects { testCompile "org.codehaus.groovy:groovy-all:2.4.5" testCompile "org.spockframework:spock-core:$spockVersion" testCompile("junit:junit:4.12") - testCompile "com.github.tomakehurst:wiremock:$wiremockVersion" + testCompile "com.github.tomakehurst:wiremock:${wiremockVersion}" + testCompile "com.toomuchcoding.jsonassert:jsonassert:${jsonAssertVersion}" testCompile "org.assertj:assertj-core:2.4.1" } } diff --git a/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties new file mode 100644 index 0000000000..428bf726fe --- /dev/null +++ b/spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin/src/test/resources/functionalTest/scenarioProject/gradle.properties @@ -0,0 +1,19 @@ +# +# Copyright 2013-2017 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +wiremockVersion=2.5.1 +jsonAssertVersion=0.4.8 + +