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

Konrad Windszus edited comment on MNG-7561 at 10/12/22 10:09 AM:
-----------------------------------------------------------------

There seems to be a difference between soft and hard requirements which is not 
really documented. Soft requirements (aka recommended versions) have to be 
given with an exact version match, while hard requirements require resolving 
(i.e. checking against metadata/repo whether they exists). Which means that a 
dependency on version {{[1]}} is valid if the version {{1.0}} exists, on the 
other hand the soft requirement {{1}} is invalid here.




was (Author: kwin):
There seems to be a difference between soft and hard references which is not 
really documented. Soft references (aka recommended versions) have to be given 
with an exact version match, while hard references require resolving (i.e. 
checking against metadata/repo whether they exists). Which means that a 
dependency on version {{[1]}} is valid if the version {{1.0}} exists, on the 
other hand the soft reference {{1}} is invalid here.



> DefaultVersionRangeResolver should not try to resolve request with same upper 
> and lower bound
> ---------------------------------------------------------------------------------------------
>
>                 Key: MNG-7561
>                 URL: https://issues.apache.org/jira/browse/MNG-7561
>             Project: Maven
>          Issue Type: Improvement
>          Components: Artifacts and Repositories
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Major
>
> For dependencies having e.g. version {{[1.0]}} the 
> DefaultVersionRangeResolver still tries to resolve versions although only a 
> single version (namely 1.0) is valid here according to 
> https://maven.apache.org/pom.html#Dependency_Version_Requirement_Specification.
>  
> This leads in the worst case to long-running calls against a remote 
> repository for no reason.
> There should be a shortcut in 
> https://github.com/apache/maven/blob/3f90e7028e0338c110aea267b44362653d55273a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java#L108
>  when the range has the same upper and lower bound.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to