Sync docs from master to gh-pages
This commit is contained in:
@@ -416,6 +416,14 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
||||
.hide-for-print{display:none!important}
|
||||
.show-for-print{display:inherit!important}}
|
||||
</style>
|
||||
<style>
|
||||
.hidden { display: none;}.switch { border-width: 1px 1px 0 1px; border-style: solid; border-color: #7a2518; display: inline-block;}.switch--item { padding: 10px; background-color: #ffffff; color: #7a2518; display: inline-block; cursor: pointer;}.switch--item.selected { background-color: #7a2519; color: #ffffff;}
|
||||
</style>
|
||||
|
||||
<script src="http://cdnjs.cloudflare.com/ajax/libs/zepto/1.1.6/zepto.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
function addBlockSwitches() { $('.primary').each(function() { primary = $(this); createSwitchItem(primary, createBlockSwitch(primary)).item.addClass("selected"); primary.children('.title').remove(); }); $('.secondary').each(function(idx, node) { secondary = $(node); primary = findPrimary(secondary); switchItem = createSwitchItem(secondary, primary.children('.switch')); switchItem.content.addClass('hidden'); findPrimary(secondary).append(switchItem.content); secondary.remove(); });}function createBlockSwitch(primary) { blockSwitch = $('<div class="switch"></div>'); primary.prepend(blockSwitch); return blockSwitch;}function findPrimary(secondary) { candidate = secondary.prev(); while (!candidate.is('.primary')) { candidate = candidate.prev(); } return candidate;}function createSwitchItem(block, blockSwitch) { blockName = block.children('.title').text(); content = block.children('.content').first().append(block.next('.colist')); item = $('<div class="switch--item">' + blockName + '</div>'); item.on('click', '', content, function(e) { $(this).addClass('selected'); $(this).siblings().removeClass('selected'); e.data.siblings('.content').addClass('hidden'); e.data.removeClass('hidden'); }); blockSwitch.append(item); return {'item': item, 'content': content};}$(addBlockSwitches);
|
||||
</script>
|
||||
</head>
|
||||
<body class="article toc2 toc-left">
|
||||
<div id="header">
|
||||
@@ -457,7 +465,6 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
||||
<li><a href="#_dependencies">Dependencies</a></li>
|
||||
<li><a href="#_additional_links">Additional links</a>
|
||||
<ul class="sectlevel4">
|
||||
<li><a href="#_videos">Videos</a></li>
|
||||
<li><a href="#_readings">Readings</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -549,23 +556,13 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
||||
<li><a href="#_scenario_3_no_output_message">Scenario 3 (no output message)</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_consumer_stub_side_generation">Consumer Stub Side generation</a>
|
||||
<ul class="sectlevel4">
|
||||
<li><a href="#_gradle_setup">Gradle Setup</a></li>
|
||||
<li><a href="#_maven_setup">Maven Setup</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_consumer_stub_side_generation">Consumer Stub Side generation</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_spring_cloud_contract_stub_runner">Spring Cloud Contract Stub Runner</a>
|
||||
<ul class="sectlevel3">
|
||||
<li><a href="#_snapshot_versions">Snapshot versions</a></li>
|
||||
<li><a href="#_publishing_stubs_as_jars">Publishing stubs as JARs</a>
|
||||
<ul class="sectlevel4">
|
||||
<li><a href="#_gradle">Gradle</a></li>
|
||||
<li><a href="#_maven">Maven</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_publishing_stubs_as_jars">Publishing stubs as JARs</a></li>
|
||||
<li><a href="#_modules">Modules</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -715,18 +712,8 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
||||
<li><a href="#_common_jar">Common JAR</a></li>
|
||||
<li><a href="#_adding_the_dependency_to_project">Adding the dependency to project</a>
|
||||
<ul class="sectlevel4">
|
||||
<li><a href="#_test_dependency_in_project_s_dependencies">Test dependency in project’s dependencies</a>
|
||||
<ul class="sectlevel5">
|
||||
<li><a href="#_adding_test_dependency_in_maven">Adding test dependency in Maven</a></li>
|
||||
<li><a href="#_adding_test_dependency_in_gradle">Adding test dependency in Gradle</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_test_dependency_in_plugin_s_dependencies">Test dependency in plugin’s dependencies</a>
|
||||
<ul class="sectlevel5">
|
||||
<li><a href="#_adding_test_plugin_dependency_in_maven">Adding test plugin dependency in Maven</a></li>
|
||||
<li><a href="#_adding_test_plugin_dependency_in_gradle">Adding test plugin dependency in Gradle</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#_test_dependency_in_project_s_dependencies">Test dependency in project’s dependencies</a></li>
|
||||
<li><a href="#_test_dependency_in_plugin_s_dependencies">Test dependency in plugin’s dependencies</a></li>
|
||||
<li><a href="#_referencing_classes_in_dsls">Referencing classes in DSLs</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -1407,10 +1394,8 @@ all the contract are present in the producer’s repository
|
||||
<div class="paragraph">
|
||||
<p>If using the <strong>SNAPSHOT</strong> / <strong>Milestone</strong> / <strong>Release Candidate</strong> versions please add the following section to your</p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Maven POM</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock primary">
|
||||
<div class="title">Maven</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml"><repositories>
|
||||
<repository>
|
||||
@@ -1466,10 +1451,8 @@ all the contract are present in the producer’s repository
|
||||
</pluginRepositories></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>Gradle build</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock secondary">
|
||||
<div class="title">Gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">repositories {
|
||||
mavenCentral()
|
||||
@@ -2074,42 +2057,6 @@ example of achieving the same by changing the properties.</p>
|
||||
is under constant development.</p>
|
||||
</div>
|
||||
<div class="sect4">
|
||||
<h5 id="_videos">Videos</h5>
|
||||
<div class="paragraph">
|
||||
<p><strong>Marcin Grzejszczak and Jakub Kubryński talking about Spring Cloud Contract Verifier</strong></p>
|
||||
</div>
|
||||
<div class="videoblock">
|
||||
<div class="content">
|
||||
<iframe src="https://www.youtube.com/embed/msRFcQM07-Y?rel=0" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><a href="https://www.youtube.com/watch?v=msRFcQM07-Y">click here to see the video</a></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><strong>Olga Maciaszek-Sharma talking about Accurest (Spring Cloud Contract Verifier predecessor)</strong></p>
|
||||
</div>
|
||||
<div class="videoblock">
|
||||
<div class="content">
|
||||
<iframe src="https://www.youtube.com/embed/daafmTYFoDU?rel=0" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><a href="https://www.youtube.com/watch?v=daafmTYFoDU">click here to see the video</a></p>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><strong>Marcin Grzejszczak and Jakub Kubryński talking about Accurest (Spring Cloud Contract Verifier predecessor)</strong></p>
|
||||
</div>
|
||||
<div class="videoblock">
|
||||
<div class="content">
|
||||
<iframe src="https://player.vimeo.com/video/130779882" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p><a href="https://vimeo.com/130779882">click here to see the video</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect4">
|
||||
<h5 id="_readings">Readings</h5>
|
||||
<div class="ulist">
|
||||
<ul>
|
||||
@@ -4007,12 +3954,42 @@ and proper stubbed routes are created.</p>
|
||||
<div class="paragraph">
|
||||
<p>For more information please consult the Stub Runner Messaging sections.</p>
|
||||
</div>
|
||||
<div class="sect4">
|
||||
<h5 id="_gradle_setup">Gradle Setup</h5>
|
||||
<div class="paragraph">
|
||||
<p>Example of Spring Cloud Contract Verifier Gradle setup:</p>
|
||||
<div class="listingblock primary">
|
||||
<div class="title">Maven</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml"><dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-stream-test-support</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-dependencies</artifactId>
|
||||
<version>Camden.BUILD-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement></code></pre>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
</div>
|
||||
<div class="listingblock secondary">
|
||||
<div class="title">Gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">ext {
|
||||
contractsDir = file("mappings")
|
||||
@@ -4035,13 +4012,6 @@ publishing {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect4">
|
||||
<h5 id="_maven_setup">Maven Setup</h5>
|
||||
<div class="paragraph">
|
||||
<p>Example of Maven can be found in the <a href="https://github.com/spring-cloud/spring-cloud-contract/tree/master/samples/standalone/messaging/stream-sink/pom.xml">Stream Sink sample</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_spring_cloud_contract_stub_runner">Spring Cloud Contract Stub Runner</h3>
|
||||
@@ -4061,23 +4031,8 @@ automatically for you.</p>
|
||||
<div class="paragraph">
|
||||
<p>Add the additional snapshot repository to your build.gradle to use snapshot versions which are automatically uploaded after every successful build:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url "http://repo.spring.io/snapshot" }
|
||||
maven { url "http://repo.spring.io/milestone" }
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="paragraph">
|
||||
<p>for Maven</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock primary">
|
||||
<div class="title">Maven</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml"><repositories>
|
||||
<repository>
|
||||
@@ -4133,18 +4088,109 @@ automatically for you.</p>
|
||||
</pluginRepositories></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listingblock secondary">
|
||||
<div class="title">Gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
maven { url "http://repo.spring.io/snapshot" }
|
||||
maven { url "http://repo.spring.io/milestone" }
|
||||
maven { url "http://repo.spring.io/release" }
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_publishing_stubs_as_jars">Publishing stubs as JARs</h4>
|
||||
<div class="paragraph">
|
||||
<p>The easiest approach would be to centralize the way stubs are kept. For example you can keep them as JARs in a Maven repository.</p>
|
||||
</div>
|
||||
<div class="sect4">
|
||||
<h5 id="_gradle">Gradle</h5>
|
||||
<div class="paragraph">
|
||||
<p>Example of Spring Cloud Contract Verifier Gradle setup:</p>
|
||||
<div class="admonitionblock tip">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<div class="title">Tip</div>
|
||||
</td>
|
||||
<td class="content">
|
||||
For both Maven and Gradle the setup comes out of the box. But you can customize it if you want to.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock primary">
|
||||
<div class="title">Maven</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml"><!-- First disable the default jar setup in the properties section-->
|
||||
<!-- we don't want the verifier to do a jar for us -->
|
||||
<spring.cloud.contract.verifier.skip>true</spring.cloud.contract.verifier.skip>
|
||||
|
||||
<!-- Next add the assembly plugin to your build -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>stub</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<inherited>false</inherited>
|
||||
<configuration>
|
||||
<attach>true</attach>
|
||||
<descriptor>${basedir}/src/assembly/stub.xml</descriptor>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Finally setup your assembly. Below you can find the contents of src/main/assembly/stub.xml -->
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
|
||||
<id>stubs</id>
|
||||
<formats>
|
||||
<format>jar</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>src/main/java</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>**com/example/model/*.*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/classes</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>**com/example/model/*.*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}/snippets/stubs</directory>
|
||||
<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/mappings</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${basedir}/src/test/resources/contracts</directory>
|
||||
<outputDirectory>META-INF/${project.groupId}/${project.artifactId}/${project.version}/contracts</outputDirectory>
|
||||
<includes>
|
||||
<include>**/*.groovy</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="listingblock secondary">
|
||||
<div class="title">Gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">ext {
|
||||
contractsDir = file("mappings")
|
||||
@@ -4167,13 +4213,6 @@ publishing {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect4">
|
||||
<h5 id="_maven">Maven</h5>
|
||||
<div class="paragraph">
|
||||
<p>Example of Maven can be found in the <a href="https://github.com/spring-cloud/spring-cloud-contract/">Spring Cloud Contract Verifier README</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect3">
|
||||
<h4 id="_modules">Modules</h4>
|
||||
|
||||
@@ -6201,6 +6240,7 @@ parts in your contracts in the following way</p>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">value(consumer(...), producer(...))
|
||||
value(c(...), p(...))
|
||||
value(stub(...), test(...))
|
||||
value(client(...), server(...))</code></pre>
|
||||
</div>
|
||||
@@ -6211,6 +6251,7 @@ value(client(...), server(...))</code></pre>
|
||||
<div class="listingblock">
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">$(consumer(...), producer(...))
|
||||
$(c(...), p(...))
|
||||
$(stub(...), test(...))
|
||||
$(client(...), server(...))</code></pre>
|
||||
</div>
|
||||
@@ -6913,9 +6954,8 @@ to pass the dependency to your project.</p>
|
||||
contracts files are available at test resources path, automatically the
|
||||
common jar classes will be visible in your Groovy files.</p>
|
||||
</div>
|
||||
<div class="sect5">
|
||||
<h6 id="_adding_test_dependency_in_maven">Adding test dependency in Maven</h6>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock primary">
|
||||
<div class="title">Maven</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml"><dependency>
|
||||
<groupId>com.example</groupId>
|
||||
@@ -6925,13 +6965,10 @@ common jar classes will be visible in your Groovy files.</p>
|
||||
</dependency></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect5">
|
||||
<h6 id="_adding_test_dependency_in_gradle">Adding test dependency in Gradle</h6>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock secondary">
|
||||
<div class="title">Gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml">testCompile("com.example:beer-common:0.0.1-SNAPSHOT")</code></pre>
|
||||
</div>
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">testCompile("com.example:beer-common:0.0.1-SNAPSHOT")</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -6940,9 +6977,8 @@ common jar classes will be visible in your Groovy files.</p>
|
||||
<div class="paragraph">
|
||||
<p>Now you have to add the dependency for the plugin to reuse at runtime.</p>
|
||||
</div>
|
||||
<div class="sect5">
|
||||
<h6 id="_adding_test_plugin_dependency_in_maven">Adding test plugin dependency in Maven</h6>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock primary">
|
||||
<div class="title">Maven</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml"><plugin>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
@@ -6968,20 +7004,10 @@ common jar classes will be visible in your Groovy files.</p>
|
||||
</plugin></code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect5">
|
||||
<h6 id="_adding_test_plugin_dependency_in_gradle">Adding test plugin dependency in Gradle</h6>
|
||||
<div class="paragraph">
|
||||
<p>Inside your <code>buildscript {}</code> section pass the following:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
<div class="listingblock secondary">
|
||||
<div class="title">Gradle</div>
|
||||
<div class="content">
|
||||
<pre class="highlight"><code class="language-xml" data-lang="xml">dependencies {
|
||||
classpath "org.springframework.boot:spring-boot-gradle-plugin:1.4.1.RELEASE"
|
||||
classpath "org.springframework.cloud:spring-cloud-contract-gradle-plugin:${findProperty('verifierVersion') ?: verifierVersion}"
|
||||
classpath "com.example:beer-common:0.0.1-SNAPSHOT"
|
||||
}</code></pre>
|
||||
</div>
|
||||
<pre class="highlight"><code class="language-groovy" data-lang="groovy">classpath "com.example:beer-common:0.0.1-SNAPSHOT"</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user