mirror of https://github.com/apache/maven.git
[MNG-4277] Remove core artifacts from ${plugin.artifacts}
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@800140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
db0e7f7407
commit
898653d5fc
|
@ -299,6 +299,7 @@ public class DefaultPluginManager
|
|||
else
|
||||
{
|
||||
artifact.setFile( null );
|
||||
artifact.setResolved( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -432,6 +433,8 @@ public class DefaultPluginManager
|
|||
logger.debug( "Populating plugin realm for " + constructPluginKey( plugin ) );
|
||||
}
|
||||
|
||||
List<Artifact> exposedPluginArtifacts = new ArrayList<Artifact>();
|
||||
|
||||
for ( Artifact a : pluginArtifacts )
|
||||
{
|
||||
if ( a.getFile() != null )
|
||||
|
@ -441,6 +444,8 @@ public class DefaultPluginManager
|
|||
logger.debug( " Included: " + a.getId() );
|
||||
}
|
||||
|
||||
exposedPluginArtifacts.add( a );
|
||||
|
||||
try
|
||||
{
|
||||
pluginRealm.addURL( a.getFile().toURI().toURL() );
|
||||
|
@ -460,8 +465,8 @@ public class DefaultPluginManager
|
|||
}
|
||||
|
||||
pluginDescriptor.setClassRealm( pluginRealm );
|
||||
pluginDescriptor.setArtifacts( pluginArtifacts );
|
||||
|
||||
pluginDescriptor.setArtifacts( exposedPluginArtifacts );
|
||||
|
||||
try
|
||||
{
|
||||
for ( ComponentDescriptor componentDescriptor : pluginDescriptor.getComponents() )
|
||||
|
@ -481,8 +486,8 @@ public class DefaultPluginManager
|
|||
throw new PluginManagerException( plugin, e.getMessage(), e );
|
||||
}
|
||||
|
||||
pluginCache.put( plugin, localRepository, remoteRepositories, pluginRealm, pluginArtifacts );
|
||||
|
||||
pluginCache.put( plugin, localRepository, remoteRepositories, pluginRealm, exposedPluginArtifacts );
|
||||
|
||||
return pluginRealm;
|
||||
}
|
||||
|
||||
|
|
|
@ -227,6 +227,12 @@ public class PluginDescriptor
|
|||
this.inheritedByDefault = inheritedByDefault;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the artifacts that make up the plugin's class realm, excluding artifacts shadowed by the Maven core realm
|
||||
* like {@code maven-project}.
|
||||
*
|
||||
* @return The plugin artifacts, never {@code null}.
|
||||
*/
|
||||
public List<Artifact> getArtifacts()
|
||||
{
|
||||
return artifacts;
|
||||
|
@ -277,7 +283,7 @@ public class PluginDescriptor
|
|||
|
||||
MojoDescriptor mojoDescriptor = null;
|
||||
|
||||
for ( Iterator i = getMojos().iterator(); i.hasNext() && mojoDescriptor == null; )
|
||||
for ( Iterator<?> i = getMojos().iterator(); i.hasNext() && mojoDescriptor == null; )
|
||||
{
|
||||
MojoDescriptor desc = (MojoDescriptor) i.next();
|
||||
|
||||
|
|
Loading…
Reference in New Issue