# Why does the Gradle pick a version outside of the range?

**URL:** <https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079>\
**Category:** Help/Discuss\
**Created:** [July 21, 2023, 12:15am UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079 "2023-07-21T00:15:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![GokhanArik](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@GokhanArik](https://discuss.gradle.org/u/GokhanArik)\
**Post date:** [July 21, 2023, 12:15am UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079/1 "2023-07-21T00:15:41Z")

</div>

Hi all,

I have this report from my dependency insights. In this configuration, `4.0.0` is excluded but Gradle still picks that version. Shouldn’t it fail or am I missing some thing:

`com.example:some-dependency:{strictly [3.114.7,4.0.0[; prefer 3.114.7} -> 4.0.0`

Thanks

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [July 21, 2023, 1:14pm UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079/2 "2023-07-21T13:14:34Z")

</div>

Don’t use the obsolete Spring Dependency Management plugin, but use the built-in BOM support using `platform(...)` instead. 😉

---

<div class="post-metadata">

**Author:** ![GokhanArik](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@GokhanArik](https://discuss.gradle.org/u/GokhanArik)\
**Post date:** [August 3, 2023, 12:25am UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079/3 "2023-08-03T00:25:09Z")

</div>

We are not using Spring plugin

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [August 3, 2023, 7:52am UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079/4 "2023-08-03T07:52:32Z")

</div>

Ok, sorry then, that was an 80 % chance. 😃  
Do you have any manual resolution strategies configured where you might force versions?  
Can you share a build `--scan`?  
If not, you can use a combination of the `dependencies` and `dependencyInsight` tasks to maybe find out where this version is coming from.

---

<div class="post-metadata">

**Author:** ![GokhanArik](https://avatars.discourse-cdn.com/v4/letter/g/97f17d/32.png) [@GokhanArik](https://discuss.gradle.org/u/GokhanArik)\
**Post date:** [August 13, 2023, 11:40pm UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079/5 "2023-08-13T23:40:53Z")

</div>

I see. No res strategy defined. I can’t share build `--scan`. Another internal library pulls in that version (`4.0.0`). If we have `strictly < 4.0.0` it shouldn’t matter where `4.0.0` coming right? It should show an error.

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [August 14, 2023, 10:19am UTC](https://discuss.gradle.org/t/why-does-the-gradle-pick-a-version-outside-of-the-range/46079/6 "2023-08-14T10:19:23Z")

</div>

No, just during normal conflict resolution.  
If you for example somewhere use a resolution strategy that forces a certain version, which the Spring Dependencymanagement plugin for example does for you, that version is used, no matter what strict versions are defined somewhere else.
