[ 
https://issues.apache.org/jira/browse/MRESOLVER-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17287935#comment-17287935
 ] 

Tamás Cservenák edited comment on MRESOLVER-164 at 2/21/21, 12:35 PM:
----------------------------------------------------------------------

I'd agree here: {{DefaultModelResolver}} picks highest version as well, so it 
really looks like some oversight (or suboptimal behaviour that was not "worth" 
to address before?).

I'd suggest to move this issue to MNG, as Maven Resolver *has all the needed 
bits* to make this possible, it is "just "the fact that user (Maven) of 
resolver *does not make use of those bits*. [~michael-o] if you agree, pls move 
this issue to MNG...


was (Author: cstamas):
I'd agree here: {{DefaultModelResolver}} picks highest version as well, so it 
really looks like some oversight (or suboptimal behaviour that was not "worth" 
to address before?).

I'd suggest to move this issue to MNG, as Maven Resolver *has all the needed 
bits* to make this possible, it is "just "the fact that user (Maven) of 
resolver *does not make use of those bits*.

> DefaultDependencyCollector filterVersions seems always return full version 
> range
> --------------------------------------------------------------------------------
>
>                 Key: MRESOLVER-164
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-164
>             Project: Maven Resolver
>          Issue Type: Bug
>    Affects Versions: 1.4.2, 1.6.1
>            Reporter: Xiang Li
>            Priority: Major
>
> Related to MNG-7049 but I think the root cause is in maven-resolver so I 
> opened a new issue. Correct me if it is better to still use the old ticket.
> During using version ranges, I notice that maven will download all poms from 
> a version range, which happen in that 
> [loop|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L404],
>  the reason is that 
> [verFilter|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L155]
>  here seems return null. Since by default, versionFilter is set to null by 
> DefaultRepositorySystemSession, and I do not see many examples that 
> setVersionFilter get used for some reason. 
> Another thing that confuses me is that version range is resolved by 
> DefaultVersionRangeResolver in maven rather than maven-resolver here.
>  
> I wonder if it possible to set HighestVersionFilter 
> [here|https://github.com/apache/maven-resolver/blob/master/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/collect/DefaultDependencyCollector.java#L155]
>  instead of return all version range results. I am happy to contribute a PR 
> with some guidance.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to