Background
I'm running provider-side contract verification in a Spring Cloud Contract (SCC) setup where the consumer publishes stub JARs to Artifactory. The provider's pom.xml has a property that pins the consumer stub version:
<consumer-service.contract.version>3.1.15-SNAPSHOT</consumer-service.contract.version>
This version is passed to the SCC Maven plugin as the contractDependency version so the provider pulls the correct stub JAR during generateTests.
The Problem
Pinning a static version creates a silent false-positive problem:
- The consumer continuously publishes new SNAPSHOTs (
3.1.15-SNAPSHOT, 3.1.16-SNAPSHOT, etc.) with updated contracts
- The provider's
pom.xml is never updated to match
- Provider CI keeps verifying against an old stub — breaking changes in the consumer's contracts go completely undetected
- All tests pass, but the provider and consumer are actually out of sync
This defeats the purpose of consumer-driven contract testing.
What I tried
Using + or leaving the version blank in the SCC plugin configuration — both result in:
No stubs or contracts were found for [com:consumer-service:+:stubs]
SCC's LATEST_VERSION (+) doesn't seem to resolve correctly against our internal Artifactory instance for SNAPSHOT artifacts.
Question
Is there a built-in or idiomatic way in Spring Cloud Contract to always resolve the latest available stub version from a remote Artifactory repository without having to manually maintain a version pin or use an external script?
Specifically:
- Is there a supported version syntax (similar to Maven's
LATEST or RELEASE) that SCC's contractDependency resolution actually honours against Artifactory SNAPSHOT repos?
- Is there a plugin configuration option (e.g.,
snapshotCheckSkip, updateSnapshots, or resolver settings) that would force re-resolution to the latest SNAPSHOT on every build?
- Or is a pre-build metadata query (like my shell script approach) the accepted pattern for this use case?
Any guidance appreciated.
Background
I'm running provider-side contract verification in a Spring Cloud Contract (SCC) setup where the consumer publishes stub JARs to Artifactory. The provider's
pom.xmlhas a property that pins the consumer stub version:This version is passed to the SCC Maven plugin as the
contractDependencyversion so the provider pulls the correct stub JAR duringgenerateTests.The Problem
Pinning a static version creates a silent false-positive problem:
3.1.15-SNAPSHOT,3.1.16-SNAPSHOT, etc.) with updated contractspom.xmlis never updated to matchThis defeats the purpose of consumer-driven contract testing.
What I tried
Using
+or leaving the version blank in the SCC plugin configuration — both result in:SCC's
LATEST_VERSION(+) doesn't seem to resolve correctly against our internal Artifactory instance for SNAPSHOT artifacts.Question
Is there a built-in or idiomatic way in Spring Cloud Contract to always resolve the latest available stub version from a remote Artifactory repository without having to manually maintain a version pin or use an external script?
Specifically:
LATESTorRELEASE) that SCC'scontractDependencyresolution actually honours against Artifactory SNAPSHOT repos?snapshotCheckSkip,updateSnapshots, or resolver settings) that would force re-resolution to the latest SNAPSHOT on every build?Any guidance appreciated.