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

ASF GitHub Bot commented on MNG-7529:
-------------------------------------

hgschmie commented on code in PR #795:
URL: https://github.com/apache/maven/pull/795#discussion_r957987649


##########
maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultVersionRangeResolver.java:
##########
@@ -242,6 +231,28 @@ private Versioning readVersions( RepositorySystemSession 
session, RequestTrace t
         return ( versioning != null ) ? versioning : new Versioning();
     }
 
+    private Versioning filterVersionsByRepositoryType( Versioning versioning, 
RemoteRepository remoteRepository )
+    {
+        if ( remoteRepository == null )
+        {
+            return versioning;
+        }
+
+        Versioning filteredVersions = versioning.clone();
+
+        for ( String version : versioning.getVersions() )
+        {
+            boolean snapshotVersion = version != null && version.endsWith( 
SNAPSHOT );

Review Comment:
   looking at 
https://maven.apache.org/ref/3.8.6/maven-repository-metadata/repository-metadata.html#versioning,
 it is IMHO clear that the versions that this method checks are either release 
versions or versions ending with `-SNAPSHOT` as this list are versions 
available in the remote repository. The remote repository does not expose the 
separate, timestamped versions but only the `-SNAPSHOT` version as that is what 
the user uses in the pom file and what the repository serves. The timestamped 
versions would be here: 
https://maven.apache.org/ref/3.8.6/maven-repository-metadata/repository-metadata.html#snapshotversion
 and that would be used for resolving the actual file on disk for a specific 
snapshot. 





> Maven resolver makes bad repository choices when resolving version ranges
> -------------------------------------------------------------------------
>
>                 Key: MNG-7529
>                 URL: https://issues.apache.org/jira/browse/MNG-7529
>             Project: Maven
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.8.6
>            Reporter: Henning Schmiedehausen
>            Priority: Major
>             Fix For: 3.8.x-candidate, 3.9.0, 4.0.0-alpha-1, 4.0.0
>
>
> This is the same problem as MRESOLVER-270. The problem is actually in the 
> maven core, not in the resolver. See the description there.
>  
> This bug is a placeholder for the fix PR.



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

Reply via email to