From 6aa1345a03538e076e19f8ff9e6e067eb8c5a27e Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 7 Sep 2016 08:18:51 +0000 Subject: [PATCH] Sync docs from master to gh-pages --- spring-cloud-contract.html | 47 +++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/spring-cloud-contract.html b/spring-cloud-contract.html index 48e6a86da0..9e48a74f06 100644 --- a/spring-cloud-contract.html +++ b/spring-cloud-contract.html @@ -511,6 +511,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
  • Scenarios
  • +
  • Stubs and transitive dependencies
  • Spring Cloud Contract Verifier Messaging @@ -2696,6 +2697,50 @@ a WireMock server configured using stubs generated by Spring Cloud Contract Veri

    Spring Cloud Contract Verifier will also generate tests with guaranteed order of execution.

    +
    +

    Stubs and transitive dependencies

    +
    +

    The Maven and Gradle plugin that we’re created are adding the tasks that create the stubs jar for you. What can be problematic +is that when reusing the stubs you can by mistake import all of that stub dependencies! When building a Maven artifact +even though you have a couple of different jars, all of them share one pom:

    +
    +
    +
    +
    ├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar
    +├── github-webhook-0.0.1.BUILD-20160903.075506-1-stubs.jar.sha1
    +├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar
    +├── github-webhook-0.0.1.BUILD-20160903.075655-2-stubs.jar.sha1
    +├── github-webhook-0.0.1.BUILD-SNAPSHOT.jar
    +├── github-webhook-0.0.1.BUILD-SNAPSHOT.pom
    +├── github-webhook-0.0.1.BUILD-SNAPSHOT-stubs.jar
    +├── ...
    +└── ...
    +
    +
    +
    +

    There are three possibilities of working with those dependencies so as not to have any issues with transitive dependencies.

    +
    +
    +

    Mark all application dependencies as optional

    +
    +
    +

    If in the github-webhook application we would mark all of our dependencies as optional, when you include the +github-webhook stubs in another application (or when that dependency gets downloaded by Stub Runner) then, since +all of the depenencies are optional, they will not get downloaded.

    +
    +
    +

    Create a separate artifactid for stubs

    +
    +
    +

    If you create a separate artifactid then you can set it up in whatever way you wish. For example by having no dependencies at all.

    +
    +
    +

    Exclude dependencies on the consumer side

    +
    +
    +

    As a consumer, if you add the stub dependency to your classpath you can explicitly exclude the unwanted dependencies.

    +
    +

    Spring Cloud Contract Verifier Messaging

    @@ -5787,7 +5832,7 @@ number of different ways, including as described above using