Updated docs

This commit is contained in:
Marcin Grzejszczak
2016-09-02 12:02:35 +02:00
parent 70013138e1
commit 4d401df5c3
5 changed files with 113 additions and 67 deletions

26
_includes/build.gradle Normal file
View File

@@ -0,0 +1,26 @@
buildscript {
dependencies {
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
// if using Stub Runner (consumer side) only remove this dependency
classpath "{@= groupId @}:spring-cloud-contract-gradle-plugin:{@= version @}"
}
}
apply plugin: "io.spring.dependency-management"
apply plugin: 'contract-verifier'
dependencyManagement {
imports {
mavenBom '{@= groupId @}:spring-cloud-contract-dependencies:{@= version @}'
}
}
dependencies {
testCompile '{@= groupId @}:spring-cloud-starter-contract-verifier'
}
// In this section you define all Spring Cloud Contract Verifier Gradle Plugin properties
contractVerifier {
baseClassForTests = 'com.example.MvcTest'
// fully qualified name to a class that will be the base class for your generated test classes
}

View File

@@ -11,7 +11,12 @@ Download
your project is with a dependency management system – the snippet below can
be copied and pasted into your build. Need help? See our getting started guides
on building with <a href="http://spring.io/guides/gs/maven/">Maven</a> and
<a href="http://spring.io/guides/gs/gradle/">Gradle</a>.
<a href="http://spring.io/guides/gs/gradle/">Gradle</a>. The example below is
showing how to use the Spring Cloud Contract plugin. In order to use
Spring Cloud Contract Stub Runner you just have to use different libraries
as presented in the later part of this guide. Of course instead of adding the
BOM of the concrete dependency you can add the release train BOM and you won't
have to take care of versioning manually.
</p>
<div class="js-download-maven-widget"></div>
</div>

32
_includes/pom.xml Normal file
View File

@@ -0,0 +1,32 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>{@= groupId @}</groupId>
<artifactId>spring-cloud-contract-dependencies</artifactId>
<version>{@= version @}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>{@= groupId @}</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugin>
<groupId>{@= groupId @}</groupId>
<artifactId>spring-cloud-contract-maven-plugin</artifactId>
<version>{@= version @}</version>
<!-- Don't forget about this value !! -->
<extensions>true</extensions>
<configuration>
<!-- Provide the base class for your auto-generated tests -->
<baseClassForTests>com.example.MvcTest</baseClassForTests>
</configuration>
</plugin>
</build>

View File

@@ -100,6 +100,17 @@
</snapshots>
</repository>
</repositories>
<!-- Unnecessary if you're using Spring Cloud Stub Runner only -->
<pluginRepositories>
<repository>
<id>{@= repository.id @}</id>
<name>{@= repository.name @}</name>
<url>{@= repository.url @}</url>
<snapshots>
<enabled>{@= repository.snapshotsEnabled @}</enabled>
</snapshots>
</repository>
</pluginRepositories>
{% endhighlight %}
</script>
@@ -123,6 +134,16 @@ dependencies {
<script type="text/html" id="project-repository-gradle-widget-template">
{% highlight groovy %}
// Unnecessary if you're using Spring Cloud Stub Runner only
buildscript {
repositories {
maven {
url '{@= repository.url @}'
}
}
}
repositories {
maven {
url '{@= repository.url @}'