diff --git a/docs/src/main/asciidoc/migrations.adoc b/docs/src/main/asciidoc/migrations.adoc index 206bc85bf6..37c0a279c0 100644 --- a/docs/src/main/asciidoc/migrations.adoc +++ b/docs/src/main/asciidoc/migrations.adoc @@ -6,7 +6,108 @@ In the following document we will write about necessary migration steps between === 1.0.x -> 1.1.x -TODO: https://github.com/spring-cloud/spring-cloud-contract/issues/350 +==== New structure of generated stubs + +In `1.1.x` we have introduced a changed structure of generated stubs. So if you've +been using the following `@AutoConfigureWireMock` notation to use the stubs from classpath + +[source,java] +---- +@AutoConfigureWireMock(stubs = "classpath:/customer-stubs/mappings", port = 8084) +---- + +It will no longer work with the new stubs. You have to either change the location of stubs +to : `classpath:.../META-INF/groupId/artifactId/version/mappings` as follows + +[source,java] +---- +@AutoConfigureWireMock(stubs = "classpath:customer-stubs/META-INF/travel.components/customer-contract/1.0.2-SNAPSHOT/mappings/", port = 8084) +---- + +Or migrate to the new classpath based `@AutoConfigureStubRunner`. + +If however you don't want to do that and you want to remain with the old structure +just set your plugin tasks accordingly. Example for the structure presented in the +snippet above. + +[source,xml,indent=0,subs="verbatim,attributes",role="primary"] +.Maven +---- + + + + + true + + + + + + + + + org.apache.maven.plugins + maven-assembly-plugin + + + stub + prepare-package + + single + + false + + true + ${basedir}/src/assembly/stub.xml + + + + + + + + + + + + stubs + + jar + + false + + + ${project.build.directory}/snippets/stubs + customer-stubs/mappings + + **/* + + + + ${basedir}/src/test/resources/contracts + customer-stubs/contracts + + **/*.groovy + + + + + + +---- + +[source,groovy,indent=0,subs="verbatim,attributes",role="secondary"] +.Gradle +---- +task copyStubs(type: Copy, dependsOn: 'generateWireMockClientStubs') { +// Preserve directory structure from 1.0.X of spring-cloud-contract + from "${project.buildDir}/resources/main/customer-stubs/META-INF/${project.group}/${project.name}/${project.version}" + into "${project.buildDir}/resources/main/customer-stubs" +} +---- === 1.1.x -> 1.2.x