diff --git a/.gitignore b/.gitignore index 2fc3bbef9d..73bc80d6c4 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ build/ hs_err_pid* .DS_Store *.log +interpolated-settings.xml +interpolated-pom.xml \ No newline at end of file diff --git a/samples/standalone/dsl/http-client/pom.xml b/samples/standalone/dsl/http-client/pom.xml index 1d8b0c36ee..d8dde4584d 100644 --- a/samples/standalone/dsl/http-client/pom.xml +++ b/samples/standalone/dsl/http-client/pom.xml @@ -73,6 +73,21 @@ true + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + build + + + target + + + + @@ -145,10 +160,11 @@ gradle - install + test ./gradlew + clean build publishToMavenLocal -PverifierVersion=${spring-cloud-contract.version} diff --git a/samples/standalone/dsl/http-server/build.gradle b/samples/standalone/dsl/http-server/build.gradle index f3d24fd8e4..4cfcbf5de7 100644 --- a/samples/standalone/dsl/http-server/build.gradle +++ b/samples/standalone/dsl/http-server/build.gradle @@ -58,6 +58,10 @@ task wrapper(type: Wrapper) { gradleVersion = '2.14' } +clean.doFirst { + delete "~/.m2/repository/com/example/" +} + task resolveDependencies { doLast { project.rootProject.allprojects.each { subProject -> diff --git a/samples/standalone/dsl/http-server/pom.xml b/samples/standalone/dsl/http-server/pom.xml index a0aa704774..d7ff6ded9b 100644 --- a/samples/standalone/dsl/http-server/pom.xml +++ b/samples/standalone/dsl/http-server/pom.xml @@ -85,6 +85,27 @@ true + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + build + + + target + + + ${env.HOME}/.m2/repository/com/example/ + + **/* + + + + + @@ -189,10 +210,11 @@ gradle - install + test ./gradlew + clean build publishToMavenLocal -PverifierVersion=${spring-cloud-contract.version} diff --git a/samples/standalone/restdocs/http-client/pom.xml b/samples/standalone/restdocs/http-client/pom.xml index 5da8a47004..786ea98a90 100644 --- a/samples/standalone/restdocs/http-client/pom.xml +++ b/samples/standalone/restdocs/http-client/pom.xml @@ -153,7 +153,7 @@ gradle - install + test ./gradlew diff --git a/samples/standalone/restdocs/http-client/settings.gradle b/samples/standalone/restdocs/http-client/settings.gradle index 8dc58d5ad1..dce437c739 100644 --- a/samples/standalone/restdocs/http-client/settings.gradle +++ b/samples/standalone/restdocs/http-client/settings.gradle @@ -1 +1 @@ -rootProject.name = 'http-client' +rootProject.name = 'http-client-restdocs' diff --git a/samples/standalone/restdocs/http-server/build.gradle b/samples/standalone/restdocs/http-server/build.gradle index 0b03c38aa3..376e8fd835 100644 --- a/samples/standalone/restdocs/http-server/build.gradle +++ b/samples/standalone/restdocs/http-server/build.gradle @@ -29,6 +29,7 @@ repositories { apply plugin: 'groovy' apply plugin: 'spring-boot' apply plugin: 'maven-publish' +apply plugin: 'maven' dependencyManagement { imports { @@ -57,6 +58,38 @@ task wrapper(type: Wrapper) { gradleVersion = '2.14' } +task stubsJar(type: Jar, dependsOn: ['copySnippets', 'copySources', 'copyClasses']) { + baseName = project.name + classifier = 'stubs' + from project.file("${project.buildDir}/stubs") +} + +artifacts { + archives stubsJar +} + +task copySnippets(type: Copy, dependsOn: test) { + from "target/snippets/stubs" + into "${project.buildDir}/stubs/META-INF/${project.group}/${project.name}/${project.version}/mappings" +} + +task copySources(type: Copy) { + from "src/main/java" + include '**/model/Fraud*.*' + into "${project.buildDir}/stubs/" +} + +task copyClasses(type: Copy) { + from "${project.buildDir}/classes/main/" + include '**/model/Fraud*.*' + into "${project.buildDir}/stubs/" +} + +clean.doFirst { + delete 'target/snippets/stubs' + delete "~/.m2/repository/com/example/" +} + task resolveDependencies { doLast { project.rootProject.allprojects.each { subProject -> diff --git a/samples/standalone/restdocs/http-server/pom.xml b/samples/standalone/restdocs/http-server/pom.xml index f3cc5cca03..3144b601e4 100644 --- a/samples/standalone/restdocs/http-server/pom.xml +++ b/samples/standalone/restdocs/http-server/pom.xml @@ -178,12 +178,14 @@ gradle - install + test ./gradlew + clean build - publishToMavenLocal + + install -PverifierVersion=${spring-cloud-contract.version} diff --git a/samples/standalone/restdocs/http-server/settings.gradle b/samples/standalone/restdocs/http-server/settings.gradle index b4f382e60c..06780ec1e9 100644 --- a/samples/standalone/restdocs/http-server/settings.gradle +++ b/samples/standalone/restdocs/http-server/settings.gradle @@ -1 +1 @@ -rootProject.name = 'http-server' +rootProject.name = 'http-server-restdocs' diff --git a/samples/standalone/stream-sink/pom.xml b/samples/standalone/stream-sink/pom.xml index 33f5c10f1e..a9ce478177 100644 --- a/samples/standalone/stream-sink/pom.xml +++ b/samples/standalone/stream-sink/pom.xml @@ -78,6 +78,21 @@ true + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + build + + + target + + + + @@ -140,5 +155,34 @@ + + integration + + + + org.codehaus.mojo + exec-maven-plugin + + + gradle + test + + ./gradlew + + clean + build + publishToMavenLocal + -PverifierVersion=${spring-cloud-contract.version} + + + + exec + + + + + + + diff --git a/samples/standalone/stream-source/build.gradle b/samples/standalone/stream-source/build.gradle index 70d2512bd5..779854fe75 100644 --- a/samples/standalone/stream-source/build.gradle +++ b/samples/standalone/stream-source/build.gradle @@ -82,6 +82,10 @@ task wrapper(type: Wrapper) { gradleVersion = '2.14' } +clean.doFirst { + delete "~/.m2/repository/com/example/" +} + task resolveDependencies { doLast { project.rootProject.allprojects.each { subProject -> diff --git a/samples/standalone/stream-source/pom.xml b/samples/standalone/stream-source/pom.xml index e4994c48bd..92d19dfd06 100644 --- a/samples/standalone/stream-source/pom.xml +++ b/samples/standalone/stream-source/pom.xml @@ -80,6 +80,28 @@ com.example.source.SensorSourceTestBase + + + org.apache.maven.plugins + maven-clean-plugin + 3.0.0 + + + + build + + + target + + + ${env.HOME}/.m2/repository/com/example/ + + **/* + + + + + maven-deploy-plugin @@ -178,5 +200,34 @@ + + integration + + + + org.codehaus.mojo + exec-maven-plugin + + + gradle + test + + ./gradlew + + clean + build + publishToMavenLocal + -PverifierVersion=${spring-cloud-contract.version} + + + + exec + + + + + + + diff --git a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/ContentUtils.groovy b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/ContentUtils.groovy index 366c03f5d8..8b70559c97 100644 --- a/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/ContentUtils.groovy +++ b/spring-cloud-contract-verifier/src/main/groovy/org/springframework/cloud/contract/verifier/util/ContentUtils.groovy @@ -78,15 +78,15 @@ class ContentUtils { } // else Brute force :( try { - log.debug("No content type provided so trying to parse as JSON") + log.trace("No content type provided so trying to parse as JSON") return extractValueForJSON(bodyAsValue, valueProvider) } catch(JsonException e) { // Not a JSON format - log.debug("Failed to parse as JSON - trying to parse as XML", e) + log.trace("Failed to parse as JSON - trying to parse as XML", e) try { return extractValueForXML(bodyAsValue, valueProvider) } catch (Exception exception) { - log.debug("No content type provided and failed to parse as XML - returning the value back to the user", exception) + log.trace("No content type provided and failed to parse as XML - returning the value back to the user", exception) return extractValueForGString(bodyAsValue, valueProvider) } }