without this change Aether, when having both local and remote JARs, always picks the local one, even though we don't want it to. There seems to be no way to change it via an API. We had a check in Spring Cloud Contract to throw an exception when we wanted a remote JAR but the local one was fetched. You could have changed it by providing a system property or a plugin property called `skipSnapshotCheck` or `contractsSkipSnapshotCheck`
with this change we're deprecating that flag since we're moving this logic to the internals of how we integrate with Aether. If the problem was that there was both the local and the remote JAR, what we could do is get rid of the local JAR. Obviously we don't want to remove it so what we're doing is when someone provides the REMOTE stub mode, we're creating a temporary directory and we're temporarily pointing Aether to that directory as our local m2. Since it's empty, Aether will not assume that we have any stubs stored locally. Thus, we will never have conflicts of remote vs local jars.
fixes gh-643
additional links:
- http://maven.40175.n5.nabble.com/Resolving-an-Artifact-from-Remote-Repository-instead-of-Local-td5875134.html
- https://stackoverflow.com/questions/9123004/maven-is-it-possible-to-override-location-of-local-repository-via-the-use-of-co
when stubsMode is set to LOCAL or REMOTE, and repositoryRoot starts with git:// we can clone the provided git repository, and search for the folder with stubs for the given artifact. So if the git repo has a folder structure of groupid/artifactid/version (where group id is either dot or slash separated), then we will provide a path to that repository for the stub runner to harvest the stubs
- externalized versions
- added more debugging messages
- added ContractProjectUpdater that updates the project containing contracts from SCM. ATM supports only git
- added ResourceResolver that retrieves the ProtocolResolvers. It does it via spring.factories entries containing StubDownloaderBuilder. SDP extends ProtocolResovler.
added StubRunner.properties map, that will contain any properties that will be later used by any StubDownloader implementations
- added PUBLISH_STUBS_TO_SCM env var for Docker, so that publishStubsToScm task gets called
- updated docs
Breaking:
- StubDownloaderBuilder extends ProtocolResovler. By default the ProtocolResolver methods return null.
- stubRunnerOptions.stubRepositoryRoot is a Resource not a String
- generateWireMockClientStubs Gradle task got removed
- if folder with contracts has a subfolder called contracts, we will pick contracts from the subfolder
fixes#580