How do I force gradle to use release versions and not snapshot versions for dependencies? I want to fail the build if a snapshot dependency is used. Is this available with a property on dependencies? or some other means?
1 Like
You could use a dependency resolve rule:
configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.version.endsWith("-SNAPSHOT") {
throw new GradleException("found snapshot dependency")
}
}
}
You can learn more about this API in the Gradle Build Language Reference (e.g. starting from ‘Configuration’).
1 Like