[
https://issues.apache.org/jira/browse/MNG-7049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17285640#comment-17285640
]
Xiang Li edited comment on MNG-7049 at 2/17/21, 9:09 PM:
---------------------------------------------------------
After some digging through the code, I found that it process every dependency
of a certain version
[[range|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L404],],]
I wonder if it is intended while it can directly return the highest version.
Appreciate any guidance.
If not return whole verion set but the highest version
[here|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L682],
it seems stop those pom downloads.
[~michael-o]
was (Author: xiangli1996):
After some digging through the code, I found that it process every dependency
of a certain version
[[range|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L404],],]
I wonder if it is intended while it can directly return the highest version.
Appreciate any guidance.
If not return whole verion set
[here|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L682],
it seems stop those pom downloads.
[~michael-o]
> Version range resolution downloads all poms, not just the highest version
> -------------------------------------------------------------------------
>
> Key: MNG-7049
> URL: https://issues.apache.org/jira/browse/MNG-7049
> Project: Maven
> Issue Type: Improvement
> Components: core
> Reporter: Moti Nisenson-Ken
> Priority: Major
>
> 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:
> # Performance - it's downloading numerous poms that aren't needed.
> # 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]
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)