[MDEP-401][MDEP-402] Adding excludeReactor parameter and getPluginArtifactsFilter() method, to make use of in/exclude parameters already in existence from the resolve-plugins mojo. Also adding ITs to verify this functionality.
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk@1448351 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index eb409dd..1a25cf6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -141,7 +141,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
- <version>2.3-SNAPSHOT</version>
+ <version>2.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
diff --git a/src/it/resolve-plugins-exclude-reactor/child-a/pom.xml b/src/it/resolve-plugins-exclude-reactor/child-a/pom.xml
new file mode 100644
index 0000000..26f4902
--- /dev/null
+++ b/src/it/resolve-plugins-exclude-reactor/child-a/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>child-a</artifactId>
+ <packaging>maven-plugin</packaging>
+
+ <name>Resolve-plugins skip reactor plugin</name>
+
+</project>
diff --git a/src/it/resolve-plugins-exclude-reactor/child-a/src/main/resources/DoNotDelete.xml b/src/it/resolve-plugins-exclude-reactor/child-a/src/main/resources/DoNotDelete.xml
new file mode 100644
index 0000000..4d3d9e4
--- /dev/null
+++ b/src/it/resolve-plugins-exclude-reactor/child-a/src/main/resources/DoNotDelete.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+<root/>
diff --git a/src/it/resolve-plugins-exclude-reactor/child-b/pom.xml b/src/it/resolve-plugins-exclude-reactor/child-b/pom.xml
new file mode 100644
index 0000000..891439a
--- /dev/null
+++ b/src/it/resolve-plugins-exclude-reactor/child-b/pom.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>child-b</artifactId>
+ <packaging>pom</packaging>
+
+ <name>Copy from reactor</name>
+ <description>
+ Test dependency:copy when searching the reactor
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>child-a</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>test</id>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>child-a</artifactId>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/it/resolve-plugins-exclude-reactor/invoker.properties b/src/it/resolve-plugins-exclude-reactor/invoker.properties
new file mode 100644
index 0000000..d65d194
--- /dev/null
+++ b/src/it/resolve-plugins-exclude-reactor/invoker.properties
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:resolve-plugins
diff --git a/src/it/resolve-plugins-exclude-reactor/pom.xml b/src/it/resolve-plugins-exclude-reactor/pom.xml
new file mode 100644
index 0000000..12450e9
--- /dev/null
+++ b/src/it/resolve-plugins-exclude-reactor/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>child-a</module>
+ <module>child-b</module>
+ </modules>
+
+ <name>resolve-plugins skip reactor plugins</name>
+ <description>
+ Test dependency:resolve-plugins to skip plugins in the reactor
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <outputFile>target/resolved.txt</outputFile>
+ <excludeReactor>true</excludeReactor>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>child-a</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/src/it/resolve-plugins-exclude-reactor/verify.groovy b/src/it/resolve-plugins-exclude-reactor/verify.groovy
new file mode 100644
index 0000000..f680111
--- /dev/null
+++ b/src/it/resolve-plugins-exclude-reactor/verify.groovy
@@ -0,0 +1,7 @@
+new File(basedir, "target/resolved.txt").eachLine { line ->
+ if ( line =~ /child-a/ ){
+ throw new RuntimeException( "Reactor plugin 'child-a' should be excluded!" )
+ }
+}
+
+return true;
diff --git a/src/it/resolve-plugins-with-exclude/invoker.properties b/src/it/resolve-plugins-with-exclude/invoker.properties
new file mode 100644
index 0000000..d65d194
--- /dev/null
+++ b/src/it/resolve-plugins-with-exclude/invoker.properties
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:resolve-plugins
diff --git a/src/it/resolve-plugins-with-exclude/pom.xml b/src/it/resolve-plugins-with-exclude/pom.xml
new file mode 100644
index 0000000..020ee85
--- /dev/null
+++ b/src/it/resolve-plugins-with-exclude/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>test</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>Test</name>
+ <description>
+ Test dependency:resolve-plugins with excluded artifactId
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <outputFile>target/resolved.txt</outputFile>
+ <excludeArtifactIds>maven-dependency-plugin,maven-surefire-plugin</excludeArtifactIds>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
diff --git a/src/it/resolve-plugins-with-exclude/test.properties b/src/it/resolve-plugins-with-exclude/test.properties
new file mode 100644
index 0000000..03bf888
--- /dev/null
+++ b/src/it/resolve-plugins-with-exclude/test.properties
@@ -0,0 +1 @@
+outputFile = target/resolved.txt
diff --git a/src/it/resolve-plugins-with-exclude/verify.groovy b/src/it/resolve-plugins-with-exclude/verify.groovy
new file mode 100644
index 0000000..14b6219
--- /dev/null
+++ b/src/it/resolve-plugins-with-exclude/verify.groovy
@@ -0,0 +1,10 @@
+new File(basedir, "target/resolved.txt").eachLine { line ->
+ if ( line =~ /maven-surefire-plugin/ ){
+ throw new RuntimeException( "Surefire plugin should be excluded!" )
+ }
+ else if ( line =~ /maven-dependency-plugin/ ){
+ throw new RuntimeException( "Dependency plugin should be excluded!" )
+ }
+}
+
+return true;
diff --git a/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java b/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
index 4779db3..cdafb1c 100644
--- a/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
+++ b/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
@@ -19,19 +19,26 @@
* under the License.
*/
+import java.io.File;
+import java.util.Set;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
+import org.apache.maven.plugin.dependency.utils.DependencyUtil;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.artifact.InvalidDependencyVersionException;
-
-import java.io.File;
-import java.util.Set;
+import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter;
+import org.apache.maven.shared.artifact.filter.collection.ClassifierFilter;
+import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
+import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter;
+import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;
+import org.apache.maven.shared.artifact.filter.collection.TypeFilter;
/**
* @author <a href="mailto:brianf@apache.org">Brian Fox</a>
@@ -75,13 +82,71 @@
@Parameter( property = "appendOutput", defaultValue = "false" )
protected boolean appendOutput;
- protected Set<Artifact> resolveDependencyArtifacts( MavenProject theProject )
+ /**
+ * Don't resolve plugins that are in the current reactor.
+ * Only works for plugins at the moment.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "excludeReactor", defaultValue = "true" )
+ protected boolean excludeReactor;
+
+ protected FilterArtifacts getPluginArtifactsFilter()
+ {
+ if ( excludeReactor )
+ {
+ final StringBuilder exAids = new StringBuilder();
+ if ( this.excludeArtifactIds != null )
+ {
+ exAids.append( this.excludeArtifactIds );
+ }
+
+ for ( final MavenProject rp : reactorProjects )
+ {
+ if ( !"maven-plugin".equals( rp.getPackaging() ) )
+ {
+ continue;
+ }
+
+ if ( exAids.length() > 0 )
+ {
+ exAids.append( "," );
+ }
+
+ exAids.append( rp.getArtifactId() );
+ }
+
+ this.excludeArtifactIds = exAids.toString();
+ }
+
+ final FilterArtifacts filter = new FilterArtifacts();
+
+ filter.addFilter( new ScopeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeScope ),
+ DependencyUtil.cleanToBeTokenizedString( this.excludeScope ) ) );
+
+ filter.addFilter( new TypeFilter( DependencyUtil.cleanToBeTokenizedString( this.includeTypes ),
+ DependencyUtil.cleanToBeTokenizedString( this.excludeTypes ) ) );
+
+ filter.addFilter( new ClassifierFilter( DependencyUtil.cleanToBeTokenizedString( this.includeClassifiers ),
+ DependencyUtil.cleanToBeTokenizedString( this.excludeClassifiers ) ) );
+
+ filter.addFilter( new GroupIdFilter( DependencyUtil.cleanToBeTokenizedString( this.includeGroupIds ),
+ DependencyUtil.cleanToBeTokenizedString( this.excludeGroupIds ) ) );
+
+ filter.addFilter( new ArtifactIdFilter( DependencyUtil.cleanToBeTokenizedString( this.includeArtifactIds ),
+ DependencyUtil.cleanToBeTokenizedString( this.excludeArtifactIds ) ) );
+
+ return filter;
+ }
+
+ protected Set<Artifact> resolveDependencyArtifacts( final MavenProject theProject )
throws ArtifactResolutionException, ArtifactNotFoundException, InvalidDependencyVersionException
{
- Set<Artifact> artifacts = theProject.createArtifacts( this.factory, Artifact.SCOPE_TEST,
- new ScopeArtifactFilter( Artifact.SCOPE_TEST ) );
+ final Set<Artifact> artifacts =
+ theProject.createArtifacts( this.factory, Artifact.SCOPE_TEST,
+ new ScopeArtifactFilter( Artifact.SCOPE_TEST ) );
- for ( Artifact artifact : artifacts )
+ for ( final Artifact artifact : artifacts )
{
// resolve the new artifact
this.resolver.resolve( artifact, this.remoteRepos, this.getLocal() );
@@ -100,15 +165,15 @@
* @throws InvalidDependencyVersionException
*
*/
- protected Set<Artifact> resolveArtifactDependencies( Artifact artifact )
+ protected Set<Artifact> resolveArtifactDependencies( final Artifact artifact )
throws ArtifactResolutionException, ArtifactNotFoundException, ProjectBuildingException,
InvalidDependencyVersionException
{
- Artifact pomArtifact =
+ final Artifact pomArtifact =
this.factory.createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), "",
"pom" );
- MavenProject pomProject =
+ final MavenProject pomProject =
mavenProjectBuilder.buildFromRepository( pomArtifact, this.remoteRepos, this.getLocal() );
return resolveDependencyArtifacts( pomProject );
diff --git a/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java b/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
index c67322e..31b62ff 100644
--- a/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
+++ b/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
@@ -19,6 +19,13 @@
* under the License.
*/
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -31,16 +38,11 @@
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.artifact.InvalidDependencyVersionException;
+import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
import org.apache.maven.shared.artifact.filter.collection.ArtifactsFilter;
+import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
import org.codehaus.plexus.util.IOUtil;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
/**
* Goal that resolves all project plugins and reports and their dependencies.
*
@@ -78,21 +80,23 @@
try
{
- Set<Artifact> plugins = resolvePluginArtifacts();
+ final Set<Artifact> plugins = resolvePluginArtifacts();
if ( this.outputFile != null )
{
- outputFile.getParentFile().mkdirs();
+ outputFile.getParentFile()
+ .mkdirs();
outputWriter = new FileWriter( outputFile );
}
- for ( Artifact plugin : plugins )
+ for ( final Artifact plugin : plugins )
{
String logStr = "Plugin Resolved: " + DependencyUtil.getFormattedFileName( plugin, false );
if ( !silent )
{
- this.getLog().info( logStr );
+ this.getLog()
+ .info( logStr );
}
if ( outputWriter != null )
@@ -103,14 +107,15 @@
if ( !excludeTransitive )
{
- for ( Artifact artifact : resolveArtifactDependencies( plugin ) )
+ for ( final Artifact artifact : resolveArtifactDependencies( plugin ) )
{
logStr =
" Plugin Dependency Resolved: " + DependencyUtil.getFormattedFileName( artifact, false );
if ( !silent )
{
- this.getLog().info( logStr );
+ this.getLog()
+ .info( logStr );
}
if ( outputWriter != null )
@@ -122,23 +127,27 @@
}
}
}
- catch ( IOException e )
+ catch ( final IOException e )
{
throw new MojoExecutionException( "Nested:", e );
}
- catch ( ArtifactResolutionException e )
+ catch ( final ArtifactResolutionException e )
{
throw new MojoExecutionException( "Nested:", e );
}
- catch ( ArtifactNotFoundException e )
+ catch ( final ArtifactNotFoundException e )
{
throw new MojoExecutionException( "Nested:", e );
}
- catch ( ProjectBuildingException e )
+ catch ( final ProjectBuildingException e )
{
throw new MojoExecutionException( "Nested:", e );
}
- catch ( InvalidDependencyVersionException e )
+ catch ( final InvalidDependencyVersionException e )
+ {
+ throw new MojoExecutionException( "Nested:", e );
+ }
+ catch ( final ArtifactFilterException e )
{
throw new MojoExecutionException( "Nested:", e );
}
@@ -155,25 +164,47 @@
* @return set of resolved plugin artifacts.
* @throws ArtifactResolutionException
* @throws ArtifactNotFoundException
+ * @throws ArtifactFilterException
*/
+ @SuppressWarnings( "unchecked" )
protected Set<Artifact> resolvePluginArtifacts()
- throws ArtifactResolutionException, ArtifactNotFoundException
+ throws ArtifactResolutionException, ArtifactNotFoundException, ArtifactFilterException
{
- @SuppressWarnings( "unchecked" ) Set<Artifact> plugins = project.getPluginArtifacts();
- @SuppressWarnings( "unchecked" ) Set<Artifact> reports = project.getReportArtifacts();
+ final Set<Artifact> plugins = project.getPluginArtifacts();
+ final Set<Artifact> reports = project.getReportArtifacts();
Set<Artifact> artifacts = new HashSet<Artifact>();
artifacts.addAll( reports );
artifacts.addAll( plugins );
- for ( Artifact artifact : artifacts )
+ final FilterArtifacts filter = getPluginArtifactsFilter();
+ artifacts = filter.filter( artifacts );
+
+ // final ArtifactFilter filter = getPluginFilter();
+ for ( final Artifact artifact : new HashSet<Artifact>( artifacts ) )
{
+ // if ( !filter.include( artifact ) )
+ // {
+ // final String logStr =
+ // String.format( " Plugin SKIPPED: %s", DependencyUtil.getFormattedFileName( artifact, false ) );
+ //
+ // if ( !silent )
+ // {
+ // this.getLog()
+ // .info( logStr );
+ // }
+ //
+ // artifacts.remove( artifact );
+ // continue;
+ // }
+
// resolve the new artifact
this.resolver.resolve( artifact, this.remotePluginRepositories, this.getLocal() );
}
return artifacts;
}
+ @Override
protected ArtifactsFilter getMarkedArtifactFilter()
{
return null;