Fixed Contract build

This commit is contained in:
Marcin Grzejszczak
2016-08-12 10:46:36 +02:00
parent 48e2908c32
commit 82302ae721
55 changed files with 759 additions and 493 deletions

View File

@@ -25,11 +25,10 @@ dependencies:
sudo service postgresql stop || echo "Service not running"
- touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
override:
- ./mvnw dependency:resolve || true
- ./scripts/downloadDependencies.sh
test:
override:
# docs take 15 minutes to run
- rm -rf ~/.m2/repository/com/example && ./mvnw clean install -P docs,integration -U $MVN_LOCAL_OPTS
- ./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent install -P docs,integration -U $MVN_LOCAL_OPTS
post:
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
- find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;

View File

@@ -7,64 +7,43 @@ Here you can find the Spring Cloud Contract folder structure
```
├── samples
├── scripts
├── spring-cloud-contract-dependencies
├── spring-cloud-contract-spec
├── spring-cloud-contract-starters
├── spring-cloud-contract-stub-runner
├── spring-cloud-contract-tools
── spring-cloud-contract-verifier
── spring-cloud-contract-verifier
├── spring-cloud-contract-wiremock
└── tests
```
- `samples` - folder contains test samples together with standalone ones used also to build documentation
- `scripts` - contains scripts to build and test `Spring Cloud Contract` with Maven, Gradle and standalone projects
- `spring-cloud-contract-dependencies` - contains Spring Cloud Contract BOM
- `spring-cloud-contract-starters` - contains Spring Cloud Contract Starters
- `spring-cloud-contract-spec` - contains specification modules (contains concept of a Contract)
- `spring-cloud-contract-stub-runner` - contains Stub Runner related modules
- `spring-cloud-contract-tools` - Gradle and Maven plugin for `Spring Cloud Contract Verifier`
- `spring-cloud-contract-verifier` - core of the `Spring Cloud Contract Verifier` functionality
- `spring-cloud-contract-wiremock` - all WireMock related functionality
- `tests` - integration tests for different messaging technologies
=== Commands
To build the core functionality together with Maven Plugin you can run
```
./mvnw clean install
./mvnw clean install -P integration
```
To build the Gradle Plugin
Calling that function will build core, Maven plugin, Gradle plugin and run end to end tests on the
standalone samples in proper order (both for Maven and Gradle).
To build the Gradle Plugin only
```
cd spring-cloud-contract-tools/spring-cloud-contract-gradle-plugin
./gradlew clean build
```
=== Scripts
For your convenience we have created a bunch of scripts to build and test the whole functionality.
Build both Maven and Gradle project
```
./scripts/build.sh
```
Run tests on the standalone projects
```
./scripts/runTests.sh
```
Build both Maven and Gradle projects and run tests on standalone projects
```
./scripts/buildAndTest.sh
```
Generate documentation
```
./scripts/generateDocs.sh
```
Publish documentation to `gh-pages`
```
./docs/src/main/asciidoc/ghpages.sh
```

View File

@@ -142,4 +142,4 @@ include::{plugins_path}/spring-cloud-contract-gradle-plugin/src/test/resources/f
===== Maven Setup
Example of Maven can be found in the https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/02-stream-sink/pom.xml[Stream Sink sample]
Example of Maven can be found in the https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/messaging/stream-sink/pom.xml[Stream Sink sample]

View File

@@ -91,65 +91,60 @@
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>

View File

@@ -139,67 +139,62 @@
</pluginManagement>
</build>
<!-- tag::repos[] -->
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<!-- end::repos[] -->
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<!-- tag::repos[] -->
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<!-- end::repos[] -->
</profile>
<profile>
<id>integration</id>
<build>

View File

@@ -16,10 +16,9 @@
<name>Spring Cloud Contract Standalone Dsl Test Samples</name>
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
<modules>
<module>http-server</module>
<module>http-client</module>
</modules>
<properties>
<spring-cloud-contract.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
</properties>
<build>
<plugins>
@@ -32,4 +31,91 @@
</plugins>
</build>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>runTests</id>
<phase>test</phase>
<configuration>
<executable>./runTests.sh</executable>
<arguments>
<argument>${spring-cloud-contract.version}</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -o errexit
VERIFIER_VERSION=$1
ROOT=`pwd`
cat <<EOF
Running tests with the following parameters
VERIFIER_VERSION=${VERIFIER_VERSION}
EOF
rm -rf ~/.m2/repository/com/example/
echo -e "\n\nRunning the tests via bash script only because we need to force order of execution."
echo -e "First server and client with Maven. Then server and client with Gradle."
echo -e "\n\nRunning tests for Maven (Messaging communication)\n\n"
echo -e "Building server"
cd ${ROOT}/http-server
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION}
echo -e "Building client"
cd ${ROOT}/http-client
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION}
rm -rf ~/.m2/repository/com/example/
echo -e "\n\nRunning tests for Gradle (Messaging communication)\n\n"
echo -e "Building server"
cd ${ROOT}/http-server
./mvnw clean install -DskipTests -Dspring-contract.version=${VERIFIER_VERSION} -P integration
echo -e "Building client"
cd ${ROOT}/http-client
./mvnw clean install -DskipTests -Dspring-contract.version=${VERIFIER_VERSION} -P integration

View File

@@ -0,0 +1,121 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-contract-samples-standalone</artifactId>
<version>1.0.0.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>spring-cloud-contract-samples-messaging</artifactId>
<packaging>pom</packaging>
<name>Spring Cloud Contract Standalone Dsl Test Samples With Messaging</name>
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
<properties>
<spring-cloud-contract.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>runTests</id>
<phase>test</phase>
<configuration>
<executable>./runTests.sh</executable>
<arguments>
<argument>${spring-cloud-contract.version}</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -o errexit
VERIFIER_VERSION=$1
ROOT=`pwd`
cat <<EOF
Running tests with the following parameters
VERIFIER_VERSION=${VERIFIER_VERSION}
EOF
rm -rf ~/.m2/repository/com/example/
echo -e "\n\nRunning the tests via bash script only because we need to force order of execution."
echo -e "First server and client with Maven. Then server and client with Gradle."
echo -e "\n\nRunning tests for Maven (Messaging communication)\n\n"
echo -e "Building server"
cd ${ROOT}/stream-source
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION}
echo -e "Building client"
cd ${ROOT}/stream-sink
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION}
rm -rf ~/.m2/repository/com/example/
echo -e "\n\nRunning tests for Gradle (Messaging communication)\n\n"
echo -e "Building server"
cd ${ROOT}/stream-source
./mvnw clean install -DskipTests -Dspring-contract.version=${VERIFIER_VERSION} -P integration
echo -e "Building client"
cd ${ROOT}/stream-sink
./mvnw clean install -DskipTests -Dspring-contract.version=${VERIFIER_VERSION} -P integration

View File

@@ -96,65 +96,60 @@
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>

View File

@@ -141,65 +141,60 @@
</pluginManagement>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>

View File

@@ -21,10 +21,7 @@
</properties>
<modules>
<module>dsl</module>
<module>restdocs</module>
<module>01-stream-source</module>
<module>02-stream-sink</module>
</modules>
<build>

View File

@@ -92,57 +92,60 @@
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>
@@ -157,6 +160,7 @@
<configuration>
<executable>./gradlew</executable>
<arguments>
<argument>clean</argument>
<argument>build</argument>
<argument>publishToMavenLocal</argument>
<argument>-PverifierVersion=${spring-cloud-contract.version}</argument>

View File

@@ -101,73 +101,60 @@
</plugins>
</build>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/libs-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/libs-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-plugin-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/plugins-snapshot-local</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-plugin-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/plugins-milestone-local</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>

View File

@@ -16,10 +16,9 @@
<name>Spring Cloud Contract Standalone Restdocs Test Samples</name>
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
<modules>
<module>http-server</module>
<module>http-client</module>
</modules>
<properties>
<spring-cloud-contract.version>1.0.0.BUILD-SNAPSHOT</spring-cloud-contract.version>
</properties>
<build>
<plugins>
@@ -32,4 +31,91 @@
</plugins>
</build>
<profiles>
<profile>
<id>spring</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>http://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>spring-releases</id>
<name>Spring Releases</name>
<url>http://repo.spring.io/release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
<profile>
<id>integration</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>runTests</id>
<phase>test</phase>
<configuration>
<executable>./runTests.sh</executable>
<arguments>
<argument>${spring-cloud-contract.version}</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -o errexit
VERIFIER_VERSION=$1
ROOT=`pwd`
cat <<EOF
Running tests with the following parameters
VERIFIER_VERSION=${VERIFIER_VERSION}
EOF
rm -rf ~/.m2/repository/com/example/
echo -e "\n\nRunning the tests via bash script only because we need to force order of execution."
echo -e "First server and client with Maven. Then server and client with Gradle."
echo -e "\n\nRunning tests for Maven (Messaging communication)\n\n"
echo -e "Building server"
cd ${ROOT}/http-server
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION}
echo -e "Building client"
cd ${ROOT}/http-client
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION}
rm -rf ~/.m2/repository/com/example/
echo -e "\n\nRunning tests for Gradle (Messaging communication)\n\n"
echo -e "Building server"
cd ${ROOT}/http-server
./mvnw clean install -DskipTests -Dspring-contract.version=${VERIFIER_VERSION} -P integration
echo -e "Building client"
cd ${ROOT}/http-client
./mvnw clean install -DskipTests -Dspring-contract.version=${VERIFIER_VERSION} -P integration

View File

@@ -1,21 +0,0 @@
#!/bin/bash
set -o errexit
LOCAL_MAVEN_REPO=${LOCAL_MAVEN_REPO-~/.m2}
VERIFIER_VERSION=${VERIFIER_VERSION:-1.0.0.BUILD-SNAPSHOT}
ROOT=`pwd`
cat <<EOF
Running tests with the following parameters
LOCAL_MAVEN_REPO=${LOCAL_MAVEN_REPO}
VERIFIER_VERSION=${VERIFIER_VERSION}
EOF
echo -e "\n\nClearing saved stubs"
rm -rf $LOCAL_MAVEN_REPO/repository/org/springframework/cloud/contract/testprojects/
rm -rf $LOCAL_MAVEN_REPO/repository/com/example
echo -e "\n\nRunning tests for Maven (HTTP communication)\n\n"
echo -e "Building server (uses Spring Cloud Contract Verifier Maven Plugin)"
./mvnw clean install -Dspring-contract.version=${VERIFIER_VERSION} -P integration

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env bash
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
set -e
ADDITIONAL_MAVEN_OPTS=${ADDITIONAL_MAVEN_OPTS:--Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn}
echo "Building Maven and Gradle projects for version [$VERIFIER_VERSION]"
echo "Building Maven stuff with additional opts [$ADDITIONAL_MAVEN_OPTS]"
./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Psonar --batch-mode $ADDITIONAL_MAVEN_OPTS

View File

@@ -1,51 +0,0 @@
#!/usr/bin/env bash
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
set -e
function print_usage() {
cat <<EOF
USAGE:
You can use the following options:
-v|--version - which version of Spring Cloud Contract do you want to use
EOF
}
while [[ $# > 0 ]]
do
key="$1"
case $key in
-v|--version)
VERIFIER_VERSION="$2"
shift # past argument
;;
--help)
print_usage
exit 0
;;
*)
echo "Invalid option: [$1]"
print_usage
exit 1
;;
esac
shift # past argument or value
done
# Code grepping for the 3rd presence of "version" in pom.xml.
# The 3rd one is where we define the SC-Contract version
VERSION_NODE=`awk '/version/{i++}i==3{print; exit}' $ROOT_FOLDER/pom.xml`
# Extract the contents of the version node
VERSION_VALUE=$(sed -ne '/version/{s/.*<version>\(.*\)<\/version>.*/\1/p;q;}' <<< "$VERSION_NODE")
[[ -z "${VERIFIER_VERSION}" ]] && VERIFIER_VERSION="$VERSION_VALUE"
export VERIFIER_VERSION
echo -e "\n\nBUILDING AND RUNNING TESTS FOR VERIFIER IN VERSION [$VERIFIER_VERSION]\n\n"
echo "Building all libraries"
$ROOT_FOLDER/scripts/build.sh
echo "Running tests"
$ROOT_FOLDER/scripts/runTests.sh

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
source common.sh || source scripts/common.sh || echo "No common.sh script found..."
set -e
./mvnw clean install && ./scripts/runTests.sh && ./mvnw deploy

View File

@@ -6,5 +6,15 @@ set -e
./mvnw -s .settings.xml --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/spring-cloud-contact-gradle-plugin && ./gradlew resolveDependencies || true
cd $ROOT_FOLDER/samples/samples-standalone && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/samples-standalone && ./downloadGradleDeps.sh
cd $ROOT_FOLDER/samples/standalone/dsl/http-client && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/standalone/dsl/http-client && ./downloadGradleDeps.sh
cd $ROOT_FOLDER/samples/standalone/dsl/http-server && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/standalone/dsl/http-server && ./downloadGradleDeps.sh
cd $ROOT_FOLDER/samples/standalone/restdocs/http-client && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/standalone/restdocs/http-client && ./downloadGradleDeps.sh
cd $ROOT_FOLDER/samples/standalone/restdocs/http-server && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/standalone/restdocs/http-server && ./downloadGradleDeps.sh
cd $ROOT_FOLDER/samples/standalone/messaging/stream-sink && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/standalone/messaging/stream-sink && ./downloadGradleDeps.sh
cd $ROOT_FOLDER/samples/standalone/messaging/sream-source && ./mvnw --fail-never dependency:go-offline || true
cd $ROOT_FOLDER/samples/standalone/messaging/sream-source && ./downloadGradleDeps.sh