apache / apache/maven

[MNG-7049] Version range resolution downloads all poms, not just the highest version

Open
#7,989 14 comments 0 reactions 0 assignees View on GitHub
enhancement priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Moti Nisenson-Ken](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=mnk)** opened **[MNG-7049](https://issues.apache.org/jira/browse/MNG-7049?redirect=false)** and commented

When specifying a version range for a dependency, maven will download and try to resolve all poms in that range which satisfy the range. The usage however is only to use the highestVersion. This causes two issues:
1. Performance - it's downloading numerous poms that aren't needed.
2. Fragility - if the version range covers any "bad" poms, then the build will fail. For example, consider that for a specific version, the parent of a pom is not present in the repository. This is enough to fail any build with a version range covering that specific version, as the range resolution stage will not complete. This is particularly harmful when that version would not be selected as the highest, anyway.

Recommend to have a system property to control the desired behavior - it should be possible to short-circuit loading all the versions and to just to load the highest version.

For another user report of this see: https://stackoverflow.com/questions/25047859/restrict-maven-to-not-download-all-poms

 

---

**Issue Links:**
- [MNG-7960](https://issues.apache.org/jira/browse/MNG-7960) Artifact collection filtering
(_**"is fixed by"**_)
- [MRESOLVER-451](https://issues.apache.org/jira/browse/MRESOLVER-451) Expose version range processing strategies

- [MRESOLVER-133](https://issues.apache.org/jira/browse/MRESOLVER-133) Improve resolver performance by using breadth-first search

1 votes, 9 watchers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.