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
|
else
|
||||||
{
|
{
|
||||||
artifact.setFile( null );
|
artifact.setFile( null );
|
||||||
|
artifact.setResolved( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,6 +433,8 @@ public class DefaultPluginManager
|
||||||
logger.debug( "Populating plugin realm for " + constructPluginKey( plugin ) );
|
logger.debug( "Populating plugin realm for " + constructPluginKey( plugin ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Artifact> exposedPluginArtifacts = new ArrayList<Artifact>();
|
||||||
|
|
||||||
for ( Artifact a : pluginArtifacts )
|
for ( Artifact a : pluginArtifacts )
|
||||||
{
|
{
|
||||||
if ( a.getFile() != null )
|
if ( a.getFile() != null )
|
||||||
|
@ -441,6 +444,8 @@ public class DefaultPluginManager
|
||||||
logger.debug( " Included: " + a.getId() );
|
logger.debug( " Included: " + a.getId() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exposedPluginArtifacts.add( a );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pluginRealm.addURL( a.getFile().toURI().toURL() );
|
pluginRealm.addURL( a.getFile().toURI().toURL() );
|
||||||
|
@ -460,7 +465,7 @@ public class DefaultPluginManager
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginDescriptor.setClassRealm( pluginRealm );
|
pluginDescriptor.setClassRealm( pluginRealm );
|
||||||
pluginDescriptor.setArtifacts( pluginArtifacts );
|
pluginDescriptor.setArtifacts( exposedPluginArtifacts );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -481,7 +486,7 @@ public class DefaultPluginManager
|
||||||
throw new PluginManagerException( plugin, e.getMessage(), e );
|
throw new PluginManagerException( plugin, e.getMessage(), e );
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginCache.put( plugin, localRepository, remoteRepositories, pluginRealm, pluginArtifacts );
|
pluginCache.put( plugin, localRepository, remoteRepositories, pluginRealm, exposedPluginArtifacts );
|
||||||
|
|
||||||
return pluginRealm;
|
return pluginRealm;
|
||||||
}
|
}
|
||||||
|
|
|
@ -227,6 +227,12 @@ public class PluginDescriptor
|
||||||
this.inheritedByDefault = inheritedByDefault;
|
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()
|
public List<Artifact> getArtifacts()
|
||||||
{
|
{
|
||||||
return artifacts;
|
return artifacts;
|
||||||
|
@ -277,7 +283,7 @@ public class PluginDescriptor
|
||||||
|
|
||||||
MojoDescriptor mojoDescriptor = null;
|
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();
|
MojoDescriptor desc = (MojoDescriptor) i.next();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue