Sync docs from 1.0.x to gh-pages

This commit is contained in:
buildmaster
2017-03-10 12:08:22 +00:00
parent 1a0b5c79e4
commit ffc1c05e51
2 changed files with 72 additions and 44 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

View File

@@ -571,7 +571,6 @@ $(addBlockSwitches);
<ul class="sectlevel5">
<li><a href="#_add_gradle_plugin_with_dependencies">Add gradle plugin with dependencies</a></li>
<li><a href="#_snapshot_versions_for_gradle">Snapshot versions for Gradle</a></li>
<li><a href="#_add_maven_plugin_with_dependencies">Add maven plugin with dependencies</a></li>
<li><a href="#_add_stubs">Add stubs</a></li>
</ul>
</li>
@@ -605,6 +604,11 @@ $(addBlockSwitches);
</ul>
</li>
<li><a href="#_invoking_generated_tests_2">Invoking generated tests</a></li>
<li><a href="#_faq_with_maven_plugin">FAQ with Maven Plugin</a>
<ul class="sectlevel5">
<li><a href="#_maven_plugin_and_sts">Maven Plugin and STS</a></li>
</ul>
</li>
<li><a href="#_spring_cloud_contract_verifier_on_consumer_side_2">Spring Cloud Contract Verifier on consumer side</a></li>
</ul>
</li>
@@ -2972,49 +2976,6 @@ dependencies {
</div>
</div>
<div class="sect5">
<h6 id="_add_maven_plugin_with_dependencies">Add maven plugin with dependencies</h6>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-xml" data-lang="xml">&lt;dependencyManagement&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-contract-dependencies&lt;/artifactId&gt;
&lt;version&gt;${spring-cloud-contract.version}&lt;/version&gt;
&lt;type&gt;pom&lt;/type&gt;
&lt;scope&gt;import&lt;/scope&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;/dependencyManagement&gt;
&lt;dependencies&gt;
&lt;dependency&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-starter-contract-verifier&lt;/artifactId&gt;
&lt;scope&gt;test&lt;/scope&gt;
&lt;/dependency&gt;
&lt;/dependencies&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-contract-maven-plugin&lt;/artifactId&gt;
&lt;executions&gt;
&lt;execution&gt;
&lt;goals&gt;
&lt;goal&gt;convert&lt;/goal&gt;
&lt;goal&gt;generateStubs&lt;/goal&gt;
&lt;goal&gt;generateTests&lt;/goal&gt;
&lt;/goals&gt;
&lt;/execution&gt;
&lt;/executions&gt;
&lt;/plugin&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Read more: <a href="https://cloud.spring.io/spring-cloud-contract/spring-cloud-contract-maven-plugin/">spring-cloud-contract-maven-plugin</a></p>
</div>
</div>
<div class="sect5">
<h6 id="_add_stubs">Add stubs</h6>
<div class="paragraph">
<p>By default Spring Cloud Contract Verifier is looking for stubs in <code>src/test/resources/contracts</code> directory.</p>
@@ -3680,6 +3641,73 @@ will be extending the <code>com.example.ComBase</code> whereas the rest of tests
</div>
</div>
<div class="sect4">
<h5 id="_faq_with_maven_plugin">FAQ with Maven Plugin</h5>
<div class="sect5">
<h6 id="_maven_plugin_and_sts">Maven Plugin and STS</h6>
<div class="paragraph">
<p>In case you see the following exception while using STS</p>
</div>
<div class="imageblock">
<div class="content">
<img src="https://raw.githubusercontent.com/spring-cloud/spring-cloud-contract/1.0.x/docs/src/main/asciidoc/images/sts_exception.png" alt="STS Exception">
</div>
</div>
<div class="paragraph">
<p>when you click on the marker you should see sth like this</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-bash" data-lang="bash"> plugin:1.1.0.M1:convert:default-convert:process-test-resources) org.apache.maven.plugin.PluginExecutionException: Execution default-convert of goal org.springframework.cloud:spring-
cloud-contract-maven-plugin:1.1.0.M1:convert failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) at
org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:331) at org.eclipse.m2e.core.internal.embedder.MavenImpl$11.call(MavenImpl.java:1362) at
...
org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.lang.NullPointerException at
org.eclipse.m2e.core.internal.builder.plexusbuildapi.EclipseIncrementalBuildContext.hasDelta(EclipseIncrementalBuildContext.java:53) at
org.sonatype.plexus.build.incremental.ThreadBuildContext.hasDelta(ThreadBuildContext.java:59) at</code></pre>
</div>
</div>
<div class="paragraph">
<p>In order to fix this issue just provide the following section in your <code>pom.xml</code></p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlight"><code class="language-xml" data-lang="xml">&lt;build&gt;
&lt;pluginManagement&gt;
&lt;plugins&gt;
&lt;!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. --&gt;
&lt;plugin&gt;
&lt;groupId&gt;org.eclipse.m2e&lt;/groupId&gt;
&lt;artifactId&gt;lifecycle-mapping&lt;/artifactId&gt;
&lt;version&gt;1.0.0&lt;/version&gt;
&lt;configuration&gt;
&lt;lifecycleMappingMetadata&gt;
&lt;pluginExecutions&gt;
&lt;pluginExecution&gt;
&lt;pluginExecutionFilter&gt;
&lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
&lt;artifactId&gt;spring-cloud-contract-maven-plugin&lt;/artifactId&gt;
&lt;versionRange&gt;[1.0,)&lt;/versionRange&gt;
&lt;goals&gt;
&lt;goal&gt;convert&lt;/goal&gt;
&lt;/goals&gt;
&lt;/pluginExecutionFilter&gt;
&lt;action&gt;
&lt;execute /&gt;
&lt;/action&gt;
&lt;/pluginExecution&gt;
&lt;/pluginExecutions&gt;
&lt;/lifecycleMappingMetadata&gt;
&lt;/configuration&gt;
&lt;/plugin&gt;
&lt;/plugins&gt;
&lt;/pluginManagement&gt;
&lt;/build&gt;</code></pre>
</div>
</div>
</div>
</div>
<div class="sect4">
<h5 id="_spring_cloud_contract_verifier_on_consumer_side_2">Spring Cloud Contract Verifier on consumer side</h5>
<div class="paragraph">
<p>You can actually use the Spring Cloud Contract Verifier also for the consumer side!