mirror of https://github.com/apache/maven.git
Adding code to flush the plugin collector when reloading the plugin container, so that discovery will proceed normally in the new container instance.
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@314798 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
36c7208f9f
commit
41be861bed
|
@ -207,6 +207,8 @@ public class DefaultPluginManager
|
|||
|
||||
pluginContainer.dispose();
|
||||
|
||||
pluginCollector.flushPluginDescriptor( plugin );
|
||||
|
||||
addPlugin( plugin, pluginArtifact, project, localRepository );
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.codehaus.plexus.logging.AbstractLogEnabled;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
@ -88,4 +89,20 @@ public class MavenPluginCollector
|
|||
return (PluginDescriptor) pluginIdsByPrefix.get( prefix );
|
||||
}
|
||||
|
||||
public void flushPluginDescriptor( Plugin plugin )
|
||||
{
|
||||
pluginsInProcess.remove( plugin.getKey() );
|
||||
pluginDescriptors.remove( plugin.getKey() );
|
||||
|
||||
for ( Iterator it = pluginIdsByPrefix.entrySet().iterator(); it.hasNext(); )
|
||||
{
|
||||
Map.Entry entry = (Map.Entry) it.next();
|
||||
|
||||
if ( plugin.getKey().equals( entry.getValue() ) )
|
||||
{
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue