Introduces explicit mode of stub downloading (#503)

* Introduces explicit mode of stub downloading

you have to explicitly provide the mode [CLASSPATH, REMOTE, LOCAL] of how you want to fetch and register stubs

fixes gh-287
This commit is contained in:
Marcin Grzejszczak
2018-01-03 08:25:29 +01:00
committed by GitHub
parent d6871beeb3
commit 748e512f4d
165 changed files with 4316 additions and 165 deletions

View File

@@ -1367,8 +1367,7 @@ com.example.CustomStubDownloaderBuilder
Now you can pick a folder with the source of your stubs.
IMPORTANT: If you do not provide any implementation, then the default is used.
If you use the `repositoryRoot` property or the `workOffline` flag, then an Aether-based
implementation that downloads stubs from a remote repository is used. If you do not
provide these values, the `ClasspathStubProvider` (which will scan the classpath) is
used. If you provide more than one, then the first one on the list is used.
IMPORTANT: If you do not provide any implementation, then the default is used (scan classpath).
If you provide the `stubsMode = StubRunnerProperties.StubsMode.LOCAL` or
`, stubsMode = StubRunnerProperties.StubsMode.REMOTE` then the Aether implementation will be used
If you provide more than one, then the first one on the list is used.

View File

@@ -567,8 +567,8 @@ git merge --no-ff contract-change-pr
Now you can disable the offline work for Spring Cloud Contract Stub Runner and indicate
where the repository with your stubs is located. At this moment the stubs of the server
side are automatically downloaded from Nexus/Artifactory. You can switch off the value of
the `workOffline` parameter in your annotation. The following code shows an example of
side are automatically downloaded from Nexus/Artifactory. You can set the value of
`stubsMode` to `REMOTE`. The following code shows an example of
achieving the same thing by changing the properties.
[source,yaml,indent=0]

View File

@@ -74,8 +74,7 @@ properties. Here are their names with their default values:
|stubrunner.maxPort|15000| Maximum value of a port for a started WireMock with stubs.
|stubrunner.repositoryRoot|| Maven repo URL. If blank, then call the local maven repo.
|stubrunner.classifier|stubs| Default classifier for the stub artifacts.
|stubrunner.workOffline|false| If true, then do not contact any remote repositories to
download stubs.
|stubrunner.stubsMode|CLASSPATH| The way you want to fetch and register the stubs
|stubrunner.ids|| Array of Ivy notation stubs to download.
|stubrunner.username|| Optional username to access the tool that stores the JARs with
stubs.