mirror of https://github.com/apache/maven.git
Only filter core artifacts from plugins, not extension artifacts, as they may break the plugin by bringing in incompatible API artifacts
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@497888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c98ee0a930
commit
6c2268f0bd
|
@ -4,9 +4,20 @@ import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||||
|
|
||||||
public interface ArtifactFilterManager
|
public interface ArtifactFilterManager
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Returns a filter for core + extension artifacts.
|
||||||
|
*/
|
||||||
ArtifactFilter getArtifactFilter();
|
ArtifactFilter getArtifactFilter();
|
||||||
|
|
||||||
void excludeArtifact( String artifactId );
|
/**
|
||||||
|
* Returns a filter for only the core artifacts.
|
||||||
|
*/
|
||||||
|
ArtifactFilter getCoreArtifactFilter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exclude an extension artifact (doesn't affect getArtifactFilter's result,
|
||||||
|
* only getExtensionArtifactFilter).
|
||||||
|
* @param artifactId
|
||||||
|
*/
|
||||||
|
void excludeArtifact( String artifactId );
|
||||||
}
|
}
|
|
@ -19,9 +19,8 @@ package org.apache.maven;
|
||||||
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
|
||||||
import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
|
import org.apache.maven.artifact.resolver.filter.ExclusionSetFilter;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
|
||||||
|
@ -80,7 +79,9 @@ public class DefaultArtifactFilterManager implements ArtifactFilterManager
|
||||||
return new ExclusionSetFilter( DEFAULT_EXCLUSIONS );
|
return new ExclusionSetFilter( DEFAULT_EXCLUSIONS );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
|
* Returns the artifact filter for the core + extension artifacts.
|
||||||
|
*
|
||||||
* @see org.apache.maven.ArtifactFilterManager#getArtifactFilter()
|
* @see org.apache.maven.ArtifactFilterManager#getArtifactFilter()
|
||||||
*/
|
*/
|
||||||
public ArtifactFilter getArtifactFilter()
|
public ArtifactFilter getArtifactFilter()
|
||||||
|
@ -88,6 +89,16 @@ public class DefaultArtifactFilterManager implements ArtifactFilterManager
|
||||||
return new ExclusionSetFilter( excludedArtifacts );
|
return new ExclusionSetFilter( excludedArtifacts );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the artifact filter for the standard core artifacts.
|
||||||
|
*
|
||||||
|
* @see org.apache.maven.ArtifactFilterManager#getExtensionArtifactFilter()
|
||||||
|
*/
|
||||||
|
public ArtifactFilter getCoreArtifactFilter()
|
||||||
|
{
|
||||||
|
return new ExclusionSetFilter( DEFAULT_EXCLUSIONS );
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.apache.maven.ArtifactFilterManager#excludeArtifact(java.lang.String)
|
* @see org.apache.maven.ArtifactFilterManager#excludeArtifact(java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -354,9 +354,8 @@ public class DefaultPluginManager
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
projectPluginDependencies = MavenMetadataSource.createArtifacts( artifactFactory, plugin.getDependencies(), null,
|
projectPluginDependencies = MavenMetadataSource.createArtifacts( artifactFactory, plugin.getDependencies(), null,
|
||||||
coreArtifactFilterManager.getArtifactFilter(), project );
|
coreArtifactFilterManager.getCoreArtifactFilter(), project );
|
||||||
}
|
}
|
||||||
catch ( InvalidDependencyVersionException e )
|
catch ( InvalidDependencyVersionException e )
|
||||||
{
|
{
|
||||||
|
@ -439,7 +438,7 @@ public class DefaultPluginManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getLogger().info( "Using the following artifacts for classpath of: " + pluginArtifact.getId() + ":\n\n" + allResolved.toString().replace( ',', '\n' ) );
|
getLogger().debug( "Using the following artifacts for classpath of: " + pluginArtifact.getId() + ":\n\n" + allResolved.toString().replace( ',', '\n' ) );
|
||||||
|
|
||||||
return allResolved;
|
return allResolved;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue