Fixed build
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -34,3 +34,5 @@ build/
|
||||
hs_err_pid*
|
||||
.DS_Store
|
||||
*.log
|
||||
interpolated-settings.xml
|
||||
interpolated-pom.xml
|
||||
@@ -73,6 +73,21 @@
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>build</directory>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>target</directory>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -145,10 +160,11 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>install</phase>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<argument>clean</argument>
|
||||
<argument>build</argument>
|
||||
<argument>publishToMavenLocal</argument>
|
||||
<argument>-PverifierVersion=${spring-cloud-contract.version}</argument>
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -85,6 +85,27 @@
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>build</directory>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>target</directory>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>${env.HOME}/.m2/repository/com/example/</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
@@ -189,10 +210,11 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>install</phase>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<argument>clean</argument>
|
||||
<argument>build</argument>
|
||||
<argument>publishToMavenLocal</argument>
|
||||
<argument>-PverifierVersion=${spring-cloud-contract.version}</argument>
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>install</phase>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
|
||||
@@ -1 +1 @@
|
||||
rootProject.name = 'http-client'
|
||||
rootProject.name = 'http-client-restdocs'
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -178,12 +178,14 @@
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>install</phase>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<argument>clean</argument>
|
||||
<argument>build</argument>
|
||||
<argument>publishToMavenLocal</argument>
|
||||
<!-- For some reason publishToMavenLocal doesn't work... Please don't troll Gradle ;)-->
|
||||
<argument>install</argument>
|
||||
<argument>-PverifierVersion=${spring-cloud-contract.version}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
|
||||
@@ -1 +1 @@
|
||||
rootProject.name = 'http-server'
|
||||
rootProject.name = 'http-server-restdocs'
|
||||
|
||||
@@ -78,6 +78,21 @@
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>build</directory>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>target</directory>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -140,5 +155,34 @@
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>integration</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<argument>clean</argument>
|
||||
<argument>build</argument>
|
||||
<argument>publishToMavenLocal</argument>
|
||||
<argument>-PverifierVersion=${spring-cloud-contract.version}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -80,6 +80,28 @@
|
||||
<baseClassForTests>com.example.source.SensorSourceTestBase</baseClassForTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<configuration>
|
||||
<filesets>
|
||||
<fileset>
|
||||
<directory>build</directory>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>target</directory>
|
||||
</fileset>
|
||||
<fileset>
|
||||
<directory>${env.HOME}/.m2/repository/com/example/</directory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileset>
|
||||
</filesets>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
@@ -178,5 +200,34 @@
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>integration</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>test</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<argument>clean</argument>
|
||||
<argument>build</argument>
|
||||
<argument>publishToMavenLocal</argument>
|
||||
<argument>-PverifierVersion=${spring-cloud-contract.version}</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user