# Enforce no snapshot dependencies in gradle

**URL:** <https://discuss.gradle.org/t/enforce-no-snapshot-dependencies-in-gradle/3851>\
**Category:** Old Forum Archive\
**Created:** [February 10, 2014, 3:42pm UTC](https://discuss.gradle.org/t/enforce-no-snapshot-dependencies-in-gradle/3851 "2014-02-10T15:42:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [February 10, 2014, 4:23pm UTC](https://discuss.gradle.org/t/enforce-no-snapshot-dependencies-in-gradle/3851/2 "2014-02-10T16:23:00Z")

</div>

You could use a dependency resolve rule:

```gradle
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](http://gradle.org/docs/current/dsl/index.html) (e.g. starting from ‘Configuration’).

---

_[View the full topic](https://discuss.gradle.org/t/enforce-no-snapshot-dependencies-in-gradle/3851)._
