}
private void loadPluginMappings( String groupId, List pluginRepositories, ArtifactRepository localRepository )
throws RepositoryMetadataResolutionException
{
RepositoryMetadata metadata = new GroupRepositoryMetadata( groupId );
repositoryMetadataManager.resolve( metadata, pluginRepositories, localRepository );
Metadata repoMetadata = metadata.getMetadata();
if ( repoMetadata != null )
{
for ( Iterator pluginIterator = repoMetadata.getPlugins().iterator(); pluginIterator.hasNext(); )
{
Plugin mapping = (Plugin) pluginIterator.next();
String prefix = mapping.getPrefix();
//if the prefix has already been found, don't add it again.
//this is to preserve the correct ordering of prefix searching (MNG-2926)
if ( !pluginDefinitionsByPrefix.containsKey( prefix ) )
{
String artifactId = mapping.getArtifactId();
org.apache.maven.model.Plugin plugin = new org.apache.maven.model.Plugin();
plugin.setGroupId( metadata.getGroupId() );
plugin.setArtifactId( artifactId );
pluginDefinitionsByPrefix.put( prefix, plugin );
}