mirror of https://github.com/apache/maven.git
[MNG-6632] - Remember artifact handlers after they've been used once
Otherwise we have to go through the whole sisu engine again, which is very slow, because it does a linear scan.
This commit is contained in:
parent
d34e8fbdc0
commit
1e03388d5b
|
@ -39,11 +39,11 @@ public class DefaultArtifactHandlerManager
|
|||
@Requirement( role = ArtifactHandler.class )
|
||||
private Map<String, ArtifactHandler> artifactHandlers;
|
||||
|
||||
private Map<String, ArtifactHandler> unmanagedHandlers = new ConcurrentHashMap<>();
|
||||
private Map<String, ArtifactHandler> allHandlers = new ConcurrentHashMap<>();
|
||||
|
||||
public ArtifactHandler getArtifactHandler( String type )
|
||||
{
|
||||
ArtifactHandler handler = unmanagedHandlers.get( type );
|
||||
ArtifactHandler handler = allHandlers.get( type );
|
||||
|
||||
if ( handler == null )
|
||||
{
|
||||
|
@ -53,6 +53,10 @@ public class DefaultArtifactHandlerManager
|
|||
{
|
||||
handler = new DefaultArtifactHandler( type );
|
||||
}
|
||||
else
|
||||
{
|
||||
allHandlers.put( type, handler );
|
||||
}
|
||||
}
|
||||
|
||||
return handler;
|
||||
|
@ -61,7 +65,7 @@ public class DefaultArtifactHandlerManager
|
|||
public void addHandlers( Map<String, ArtifactHandler> handlers )
|
||||
{
|
||||
// legacy support for maven-gpg-plugin:1.0
|
||||
unmanagedHandlers.putAll( handlers );
|
||||
allHandlers.putAll( handlers );
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
|
Loading…
Reference in New Issue