rfscholte commented on a change in pull request #533:
URL: https://github.com/apache/maven/pull/533#discussion_r707086287



##########
File path: 
maven-core/src/main/java/org/apache/maven/plugin/version/internal/DefaultPluginVersionResolver.java
##########
@@ -387,6 +404,36 @@ private PluginVersionResult resolveFromProject( 
PluginVersionRequest request, Li
         return null;
     }
 
+    @SuppressWarnings( "unchecked" )
+    private Map<String, PluginVersionResult> getCache( SessionData data )
+    {
+        Map<String, PluginVersionResult> cache = ( Map<String, 
PluginVersionResult> ) data.get( CACHE_KEY );
+        while ( cache == null )
+        {
+            cache = new ConcurrentHashMap<>( 256 );
+            if ( data.set( CACHE_KEY, null, cache ) )
+            {
+                break;
+            }
+            cache = ( Map<String, PluginVersionResult> ) data.get( CACHE_KEY );
+        }
+        return cache;
+    }
+
+    private static String getKey( PluginVersionRequest request )
+    {
+        StringBuilder sb = new StringBuilder();
+        sb.append( request.getGroupId() );
+        sb.append( ':' );
+        sb.append( request.getArtifactId() );
+        for ( RemoteRepository repository : request.getRepositories() )

Review comment:
       IIRC it happened in the past that the same GAV was binary different in 2 
repo's (commons-lang?) If we need it, I don't think we should use the 
repository id, as it is maybe not unique enough (id=nexus might be used by 
several companies). The url from which the pom was downloaded should be unique.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to