Deprecating skipSnapshotCheck and providing fake m2 for Aether
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
This commit is contained in:
@@ -175,7 +175,10 @@ class ContractVerifierExtension {
|
||||
/**
|
||||
* If set to {@code true} will not assert whether the downloaded stubs / contract
|
||||
* JAR was downloaded from a remote location or a local one(only applicable to Maven repos, not Git or Pact)
|
||||
*
|
||||
* @deprecated - with 2.1.0 this option is redundant
|
||||
*/
|
||||
@Deprecated
|
||||
boolean contractsSnapshotCheckSkip = false
|
||||
|
||||
/**
|
||||
|
||||
@@ -86,7 +86,6 @@ class GradleContractsDownloader {
|
||||
.withStubsMode(extension.contractsMode)
|
||||
.withUsername(extension.contractRepository.username)
|
||||
.withPassword(extension.contractRepository.password)
|
||||
.withSnapshotCheckSkip(extension.contractsSnapshotCheckSkip)
|
||||
.withDeleteStubsAfterTest(extension.deleteStubsAfterTest)
|
||||
.withProperties(extension.contractsProperties)
|
||||
if (extension.contractRepository.proxyPort) {
|
||||
|
||||
Reference in New Issue
Block a user