Configure Maven to run Gradle where necessary
This commit is contained in:
@@ -135,6 +135,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>install</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<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>
|
||||
|
||||
@@ -179,5 +179,33 @@
|
||||
</pluginRepositories>
|
||||
<!-- end::repos[] -->
|
||||
</profile>
|
||||
<profile>
|
||||
<id>integration</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>install</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<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>
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
<name>Spring Cloud Contract Standalone Test Samples</name>
|
||||
<description>Spring Cloud Contract Standalone Test Samples used for end to end tests</description>
|
||||
|
||||
<properties>
|
||||
<verifier.version>${project.version}</verifier.version>
|
||||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>dsl</module>
|
||||
<module>restdocs</module>
|
||||
@@ -34,6 +38,21 @@
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<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>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
|
||||
@@ -143,6 +143,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>install</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<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>
|
||||
|
||||
@@ -28,7 +28,6 @@ repositories {
|
||||
|
||||
apply plugin: 'groovy'
|
||||
apply plugin: 'spring-boot'
|
||||
apply plugin: 'spring-cloud-contract'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
dependencyManagement {
|
||||
@@ -42,7 +41,10 @@ dependencies {
|
||||
compile("org.springframework.boot:spring-boot-starter-web")
|
||||
compile("org.springframework.boot:spring-boot-starter-actuator")
|
||||
|
||||
testCompile 'org.springframework.cloud:spring-cloud-starter-contract-verifier'
|
||||
testCompile 'com.google.code.gson:gson'
|
||||
testCompile 'org.springframework.boot:spring-boot-starter-test'
|
||||
testCompile 'org.springframework.restdocs:spring-restdocs-mockmvc'
|
||||
testCompile 'org.springframework.cloud:spring-cloud-contract-wiremock'
|
||||
}
|
||||
|
||||
test {
|
||||
|
||||
@@ -168,5 +168,33 @@
|
||||
</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>install</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<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>
|
||||
|
||||
@@ -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}
|
||||
@@ -16,25 +16,6 @@ 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 Gradle (HTTP communication)\n\n"
|
||||
echo -e "Building server (uses Spring Cloud Contract Verifier Gradle Plugin)"
|
||||
cd dsl/http-server
|
||||
./gradlew clean build publishToMavenLocal -PverifierVersion=${VERIFIER_VERSION} --stacktrace
|
||||
cd $ROOT
|
||||
echo -e "\n\nBuilding client (uses Spring Cloud Contract Stub Runner)"
|
||||
cd dsl/http-client
|
||||
./gradlew clean build -PverifierVersion=${VERIFIER_VERSION} --stacktrace
|
||||
cd $ROOT
|
||||
|
||||
echo -e "\n\nClearing saved stubs"
|
||||
rm -rf $LOCAL_MAVEN_REPO/repository/org/springframework/cloud/contract/testprojects/
|
||||
|
||||
echo -e "\n\nRunning tests for Gradle (communication via messaging)\n\n"
|
||||
echo -e "Building producer (uses Spring Cloud Contract Verifier Gradle Plugin)"
|
||||
cd stream-source
|
||||
./gradlew clean build publishToMavenLocal -PverifierVersion=${VERIFIER_VERSION} --stacktrace
|
||||
cd $ROOT
|
||||
echo -e "\n\nBuilding consumer (uses Spring Cloud Contract Stub Runner Messaging)"
|
||||
cd stream-sink
|
||||
./gradlew clean build -PverifierVersion=${VERIFIER_VERSION} --stacktrace
|
||||
cd $ROOT
|
||||
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
|
||||
|
||||
@@ -10,6 +10,3 @@ 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
|
||||
|
||||
echo "Building Gradle plugin"
|
||||
(cd */*-gradle-plugin; ./gradlew clean build install jacocoTestReport)
|
||||
|
||||
@@ -4,4 +4,4 @@ source common.sh || source scripts/common.sh || echo "No common.sh script found.
|
||||
|
||||
set -e
|
||||
|
||||
./mvnw clean install && (cd *-gradle-plugin; ./gradlew clean build install) && ./scripts/runTests.sh && ./mvnw deploy && (cd *-gradle-plugin; ./gradlew uploadArchives -x test)
|
||||
./mvnw clean install && ./scripts/runTests.sh && ./mvnw deploy
|
||||
|
||||
@@ -12,10 +12,7 @@ echo -e "\n\nRUNNING TESTS FOR VERIFIER IN VERSION [${VERIFIER_VERSION}]\n\n"
|
||||
|
||||
cd samples/standalone
|
||||
|
||||
echo "Running Gradle tests"
|
||||
echo "Running tests"
|
||||
./runTests.sh
|
||||
|
||||
echo "Running Maven tests"
|
||||
./runMavenTests.sh
|
||||
|
||||
cd $ROOT_FOLDER
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
<modules>
|
||||
<module>spring-cloud-contract-converters</module>
|
||||
<module>spring-cloud-contract-maven-plugin</module>
|
||||
<module>spring-cloud-contract-gradle-plugin</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -71,6 +71,8 @@ dependencies {
|
||||
|
||||
}
|
||||
|
||||
task libtest << { configurations.testCompile.files.each { println it } }
|
||||
|
||||
test {
|
||||
testLogging {
|
||||
exceptionFormat = 'full'
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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-tools</artifactId>
|
||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>spring-cloud-contract-gradle-plugin</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Spring Cloud Contract Gradle Plugin</name>
|
||||
<description>Spring Cloud Contract Gradle Plugin</description>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-verifier</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-converters</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-contract-stub-runner</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<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>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>gradle</id>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<executable>./gradlew</executable>
|
||||
<arguments>
|
||||
<argument>build</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>build-helper-maven-plugin</artifactId>
|
||||
<version>1.12</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-artifacts</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attach-artifact</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<artifacts>
|
||||
<artifact>
|
||||
<file>build/libs/${project.artifactId}-${project.version}.jar</file>
|
||||
<type>jar</type>
|
||||
</artifact>
|
||||
</artifacts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user