You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2013/02/28 05:22:42 UTC
svn commit: r1451088 - in /maven/plugins/trunk/maven-dependency-plugin/src:
main/java/org/apache/maven/plugin/dependency/
main/java/org/apache/maven/plugin/dependency/fromConfiguration/
main/java/org/apache/maven/plugin/dependency/resolvers/ test/java/...
Author: brianf
Date: Thu Feb 28 04:22:41 2013
New Revision: 1451088
URL: http://svn.apache.org/r1451088
Log:
MDEP-403 add skip parameter (patch from henning)
Added:
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-config.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-get-config.xml
Modified:
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo2.java
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractAnalyzeMojo.java Thu Feb 28 04:22:41 2013
@@ -147,6 +147,14 @@ public abstract class AbstractAnalyzeMoj
@Parameter
private String[] usedDependencies;
+ /**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
// Mojo methods -----------------------------------------------------------
/*
@@ -155,6 +163,12 @@ public abstract class AbstractAnalyzeMoj
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
if ( "pom".equals( project.getPackaging() ) )
{
getLog().info( "Skipping pom project" );
@@ -202,6 +216,16 @@ public abstract class AbstractAnalyzeMoj
this.context = context;
}
+ public boolean isSkip()
+ {
+ return skip;
+ }
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
+
// private methods --------------------------------------------------------
private boolean checkDependencies()
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Thu Feb 28 04:22:41 2013
@@ -27,6 +27,7 @@ import org.apache.maven.artifact.resolve
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.dependency.utils.DependencySilentLog;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.plugins.annotations.Component;
@@ -141,6 +142,35 @@ public abstract class AbstractDependency
@Parameter( property = "outputAbsoluteArtifactFilename", defaultValue = "false" )
protected boolean outputAbsoluteArtifactFilename;
+ /**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
+ // Mojo methods -----------------------------------------------------------
+
+ /*
+ * @see org.apache.maven.plugin.Mojo#execute()
+ */
+ public final void execute()
+ throws MojoExecutionException, MojoFailureException
+ {
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
+ doExecute();
+ }
+
+ protected abstract void doExecute()
+ throws MojoExecutionException, MojoFailureException;
+
+
private Log log;
/**
@@ -435,6 +465,17 @@ public abstract class AbstractDependency
this.useJvmChmod = useJvmChmod;
}
+ public boolean isSkip()
+ {
+ return skip;
+ }
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
+
+
private void logUnpack( File file, File location, String includes, String excludes )
{
if ( !getLog().isInfoEnabled() )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDepMgt.java Thu Feb 28 04:22:41 2013
@@ -78,6 +78,14 @@ public class AnalyzeDepMgt
@Parameter( property = "mdep.analyze.ignore.direct", defaultValue = "true" )
private boolean ignoreDirect = true;
+ /**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "mdep.analyze.skip", defaultValue = "false" )
+ private boolean skip;
+
// Mojo methods -----------------------------------------------------------
/*
@@ -86,6 +94,12 @@ public class AnalyzeDepMgt
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
boolean result = checkDependencyManagement();
if ( result )
{
@@ -346,4 +360,14 @@ public class AnalyzeDepMgt
{
this.ignoreDirect = theIgnoreDirect;
}
+
+ public boolean isSkip()
+ {
+ return skip;
+}
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeDuplicateMojo.java Thu Feb 28 04:22:41 2013
@@ -28,6 +28,7 @@ import org.apache.maven.plugin.MojoExecu
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
@@ -51,6 +52,14 @@ public class AnalyzeDuplicateMojo
extends AbstractMojo
{
/**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
+ /**
* The Maven project to analyze.
*/
@Component
@@ -62,6 +71,12 @@ public class AnalyzeDuplicateMojo
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
MavenXpp3Reader pomReader = new MavenXpp3Reader();
Model model = null;
Reader reader = null;
@@ -153,4 +168,14 @@ public class AnalyzeDuplicateMojo
return new HashSet<String>(
CollectionUtils.disjunction( modelDependencies2, new HashSet<String>( modelDependencies2 ) ) );
}
+
+ public boolean isSkip()
+ {
+ return skip;
+}
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AnalyzeReportMojo.java Thu Feb 28 04:22:41 2013
@@ -94,6 +94,14 @@ public class AnalyzeReportMojo
@Parameter
private String[] usedDependencies;
+ /**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "mdep.analyze.skip", defaultValue = "false" )
+ private boolean skip;
+
// Mojo methods -----------------------------------------------------------
/*
@@ -102,6 +110,12 @@ public class AnalyzeReportMojo
public void executeReport( Locale locale )
throws MavenReportException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
// Step 0: Checking pom availability
if ( "pom".equals( project.getPackaging() ) )
{
@@ -209,4 +223,15 @@ public class AnalyzeReportMojo
{
return ResourceBundle.getBundle( "analyze-report", locale, this.getClass().getClassLoader() );
}
+
+ public boolean isSkip()
+ {
+ return skip;
+}
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
+
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/BuildClasspathMojo.java Thu Feb 28 04:22:41 2013
@@ -173,7 +173,7 @@ public class BuildClasspathMojo
* @see #getDependencies
* @see #copyArtifact(Artifact, boolean)
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java Thu Feb 28 04:22:41 2013
@@ -54,15 +54,6 @@ import java.util.Set;
public class CopyDependenciesMojo
extends AbstractFromDependenciesMojo
{
-
- /**
- * Skip the execution
- *
- * @since 2.6
- */
- @Parameter( property = "mdep.skip", defaultValue = "false" )
- private boolean skip;
-
/**
*
*/
@@ -98,14 +89,9 @@ public class CopyDependenciesMojo
* @see #getDependencies
* @see #copyArtifact(Artifact, boolean)
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
- if ( skip )
- {
- return;
- }
-
DependencyStatusSets dss = getDependencySets( this.failOnMissingClassifierArtifact );
Set<Artifact> artifacts = dss.getResolvedDependencies();
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java Thu Feb 28 04:22:41 2013
@@ -174,9 +174,22 @@ public class GetMojo
@Parameter( property = "transitive", defaultValue = "true" )
private boolean transitive = true;
+ /**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
if ( artifactId == null && artifact == null )
{
@@ -330,4 +343,15 @@ public class GetMojo
return layout;
}
+
+ public boolean isSkip()
+ {
+ return skip;
+}
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
+
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PropertiesMojo.java Thu Feb 28 04:22:41 2013
@@ -25,6 +25,7 @@ import org.apache.maven.plugin.MojoExecu
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject;
@@ -52,6 +53,14 @@ public class PropertiesMojo
protected MavenProject project;
/**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
+ /**
* Main entry into mojo. Gets the list of dependencies and iterates through setting a property for each artifact.
*
* @throws MojoExecutionException with a message if an error occurs.
@@ -59,6 +68,12 @@ public class PropertiesMojo
public void execute()
throws MojoExecutionException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
@SuppressWarnings( "unchecked" ) Set<Artifact> artifacts = getProject().getArtifacts();
for ( Artifact artifact : artifacts )
@@ -73,4 +88,13 @@ public class PropertiesMojo
return project;
}
+ public boolean isSkip()
+ {
+ return skip;
+}
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java Thu Feb 28 04:22:41 2013
@@ -199,6 +199,14 @@ public class PurgeLocalRepositoryMojo
private boolean snapshotsOnly;
/**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
+ /**
* Includes only direct project dependencies.
*/
private class DirectDependencyFilter
@@ -288,6 +296,12 @@ public class PurgeLocalRepositoryMojo
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
+
if ( !StringUtils.isEmpty( manualInclude ) )
{
manualIncludes = this.parseIncludes( manualInclude );
@@ -657,4 +671,13 @@ public class PurgeLocalRepositoryMojo
}
}
+ public boolean isSkip()
+ {
+ return skip;
+}
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/TreeMojo.java Thu Feb 28 04:22:41 2013
@@ -178,6 +178,15 @@ public class TreeMojo
@Parameter( property = "appendOutput", defaultValue = "false" )
private boolean appendOutput;
+ /**
+ * Skip plugin execution completely.
+ *
+ * @since 2.7
+ */
+ @Parameter( property = "skip", defaultValue = "false" )
+ private boolean skip;
+
+
// Mojo methods -----------------------------------------------------------
/*
@@ -186,6 +195,11 @@ public class TreeMojo
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( isSkip() )
+ {
+ getLog().info( "Skipping plugin execution" );
+ return;
+ }
if ( output != null )
{
@@ -246,6 +260,16 @@ public class TreeMojo
return rootNode;
}
+ public boolean isSkip()
+ {
+ return skip;
+ }
+
+ public void setSkip( boolean skip )
+ {
+ this.skip = skip;
+ }
+
// private methods --------------------------------------------------------
/**
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java Thu Feb 28 04:22:41 2013
@@ -77,7 +77,7 @@ public class UnpackDependenciesMojo
* @see DependencyUtil#unpackFile(Artifact, File, File, ArchiverManager,
* Log)
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
DependencyStatusSets dss = getDependencySets( this.failOnMissingClassifierArtifact );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java Thu Feb 28 04:22:41 2013
@@ -56,14 +56,6 @@ public abstract class AbstractFromConfig
extends AbstractDependencyMojo
{
/**
- * Skip the execution
- *
- * @since 2.2
- */
- @Parameter( property = "mdep.skip", defaultValue = "false" )
- private boolean skip;
-
- /**
* Default location used for mojo unless overridden in ArtifactItem
*
* @since 1.0
@@ -536,16 +528,6 @@ public abstract class AbstractFromConfig
this.localRepositoryDirectory = localRepositoryDirectory;
}
- public boolean isSkip()
- {
- return skip;
- }
-
- public void setSkip( boolean skip )
- {
- this.skip = skip;
- }
-
public void setArtifact( String artifact )
throws MojoFailureException
{
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java Thu Feb 28 04:22:41 2013
@@ -79,14 +79,9 @@ public class CopyMojo
* @see #getArtifactItems
* @see #copyArtifact(ArtifactItem)
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException, MojoFailureException
{
- if ( isSkip() )
- {
- return;
- }
-
verifyRequirements();
List<ArtifactItem> theArtifactItems = getProcessedArtifactItems(
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java Thu Feb 28 04:22:41 2013
@@ -88,7 +88,7 @@ public final class UnpackMojo
* @see #getArtifactItems
* @see #unpackArtifact(ArtifactItem)
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException, MojoFailureException
{
if ( isSkip() )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java Thu Feb 28 04:22:41 2013
@@ -50,7 +50,7 @@ public class GoOfflineMojo
*
* @throws MojoExecutionException with a message if an error occurs.
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
@SuppressWarnings( "unchecked" ) Set<Artifact> artifacts = project.getArtifacts();
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ListRepositoriesMojo.java Thu Feb 28 04:22:41 2013
@@ -52,7 +52,7 @@ public class ListRepositoriesMojo
*
* @throws MojoExecutionException with a message if an error occurs.
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
try
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java Thu Feb 28 04:22:41 2013
@@ -64,7 +64,7 @@ public class ResolveDependenciesMojo
*
* @throws MojoExecutionException with a message if an error occurs.
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
// get sets of dependencies
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java Thu Feb 28 04:22:41 2013
@@ -46,7 +46,7 @@ public class ResolveDependencySourcesMoj
*
* @throws MojoExecutionException with a message if an error occurs.
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
if ( StringUtils.isEmpty( this.classifier ) )
@@ -54,6 +54,6 @@ public class ResolveDependencySourcesMoj
this.classifier = SOURCE_CLASSIFIER;
}
- super.execute();
+ super.doExecute();
}
}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java Thu Feb 28 04:22:41 2013
@@ -73,7 +73,7 @@ public class ResolvePluginsMojo
*
* @throws MojoExecutionException with a message if an error occurs.
*/
- public void execute()
+ protected void doExecute()
throws MojoExecutionException
{
Writer outputWriter = null;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestCopyDependenciesMojo.java Thu Feb 28 04:22:41 2013
@@ -19,6 +19,8 @@ package org.apache.maven.plugin.dependen
* under the License.
*/
+import org.apache.maven.plugin.MojoFailureException;
+
import java.io.File;
import java.io.IOException;
import java.util.HashSet;
@@ -496,7 +498,7 @@ public class TestCopyDependenciesMojo
*/
public void testDontOverWriteRelease()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -527,7 +529,7 @@ public class TestCopyDependenciesMojo
}
public void testOverWriteRelease()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -561,7 +563,7 @@ public class TestCopyDependenciesMojo
}
public void testDontOverWriteSnap()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -594,7 +596,7 @@ public class TestCopyDependenciesMojo
}
public void testOverWriteSnap()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -699,7 +701,7 @@ public class TestCopyDependenciesMojo
}
public void testExcludeTestScope()
- throws IOException
+ throws IOException, MojoFailureException
{
mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java?rev=1451088&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestSkip.java Thu Feb 28 04:22:41 2013
@@ -0,0 +1,327 @@
+package org.apache.maven.plugin.dependency;
+
+import org.apache.maven.plugin.Mojo;
+import org.apache.maven.plugin.logging.Log;
+
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/*
+ * 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.
+ */
+
+public class TestSkip
+ extends AbstractDependencyMojoTestCase
+{
+ public void testSkipAnalyze()
+ throws Exception
+ {
+ doTest("analyze");
+ }
+
+ public void testSkipAnalyzeDepMgt()
+ throws Exception
+ {
+ doTest("analyze-dep-mgt");
+ }
+
+ public void testSkipAnalyzeOnly()
+ throws Exception
+ {
+ doTest("analyze-only");
+ }
+
+ public void testSkipAnalyzeReport()
+ throws Exception
+ {
+ doSpecialTest("analyze-report");
+ }
+
+ public void testSkipAnalyzeDuplicate()
+ throws Exception
+ {
+ doTest("analyze-duplicate");
+ }
+
+ public void testSkipBuildClasspath()
+ throws Exception
+ {
+ doTest("build-classpath");
+ }
+
+ public void testSkipCopy()
+ throws Exception
+ {
+ doTest("copy");
+ }
+
+ public void testSkipCopyDependencies()
+ throws Exception
+ {
+ doTest("copy-dependencies");
+ }
+
+ public void testSkipGet()
+ throws Exception
+ {
+ doSpecialTest("get");
+ }
+
+ public void testSkipGoOffline()
+ throws Exception
+ {
+ doTest("go-offline");
+ }
+
+ public void testSkipList()
+ throws Exception
+ {
+ doTest("list");
+ }
+
+ public void testSkipProperties()
+ throws Exception
+ {
+ doTest("properties");
+ }
+
+ public void testSkipPurgeLocalRepository()
+ throws Exception
+ {
+ doTest("purge-local-repository");
+ }
+
+ public void testSkipResolve()
+ throws Exception
+ {
+ doTest("resolve");
+ }
+
+ public void testSkipResolvePlugins()
+ throws Exception
+ {
+ doTest("resolve-plugins");
+ }
+
+ public void testSkipSources()
+ throws Exception
+ {
+ doTest("sources");
+ }
+
+ public void testSkipTree()
+ throws Exception
+ {
+ doTest("tree");
+ }
+
+ public void testSkipUnpack()
+ throws Exception
+ {
+ doTest("unpack");
+ }
+
+ public void testSkipUnpackDependencies()
+ throws Exception
+ {
+ doTest("unpack-dependencies");
+ }
+
+
+ protected void doTest(String mojoName)
+ throws Exception
+ {
+ doConfigTest(mojoName, "plugin-config.xml");
+ }
+
+ protected void doSpecialTest(String mojoName)
+ throws Exception
+ {
+ doConfigTest(mojoName, "plugin-" + mojoName + "-config.xml");
+ }
+
+ private void doConfigTest(String mojoName, String configFile)
+ throws Exception
+ {
+ File testPom =
+ new File( getBasedir(), "target/test-classes/unit/skip-test/" + configFile );
+ Mojo mojo = lookupMojo( mojoName, testPom );
+ assertNotNull( mojo );
+ CapturingLog log = new CapturingLog();
+ mojo.setLog( log );
+ mojo.execute();
+
+ assertTrue( log.getContent().indexOf( "Skipping plugin execution" ) != -1 );
+ }
+
+ class CapturingLog
+ implements Log
+ {
+ StringBuilder sb = new StringBuilder();
+
+ /** {@inheritDoc} */
+ public void debug( CharSequence content )
+ {
+ print( "debug", content );
+ }
+
+ /** {@inheritDoc} */
+ public void debug( CharSequence content, Throwable error )
+ {
+ print( "debug", content, error );
+ }
+
+ /** {@inheritDoc} */
+ public void debug( Throwable error )
+ {
+ print( "debug", error );
+ }
+
+ /** {@inheritDoc} */
+ public void info( CharSequence content )
+ {
+ print( "info", content );
+ }
+
+ /** {@inheritDoc} */
+ public void info( CharSequence content, Throwable error )
+ {
+ print( "info", content, error );
+ }
+
+ /** {@inheritDoc} */
+ public void info( Throwable error )
+ {
+ print( "info", error );
+ }
+
+ /** {@inheritDoc} */
+ public void warn( CharSequence content )
+ {
+ print( "warn", content );
+ }
+
+ /** {@inheritDoc} */
+ public void warn( CharSequence content, Throwable error )
+ {
+ print( "warn", content, error );
+ }
+
+ /** {@inheritDoc} */
+ public void warn( Throwable error )
+ {
+ print( "warn", error );
+ }
+
+ /** {@inheritDoc} */
+ public void error( CharSequence content )
+ {
+ System.err.println( "[error] " + content.toString() );
+ }
+
+ /** {@inheritDoc} */
+ public void error( CharSequence content, Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ System.err.println( "[error] " + content.toString() + "\n\n" + sWriter.toString() );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#error(java.lang.Throwable)
+ */
+ public void error( Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ System.err.println( "[error] " + sWriter.toString() );
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isDebugEnabled()
+ */
+ public boolean isDebugEnabled()
+ {
+ // TODO: Not sure how best to set these for this implementation...
+ return false;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isInfoEnabled()
+ */
+ public boolean isInfoEnabled()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isWarnEnabled()
+ */
+ public boolean isWarnEnabled()
+ {
+ return true;
+ }
+
+ /**
+ * @see org.apache.maven.plugin.logging.Log#isErrorEnabled()
+ */
+ public boolean isErrorEnabled()
+ {
+ return true;
+ }
+
+ private void print( String prefix, CharSequence content )
+ {
+ sb.append( "[" + prefix + "] " ).append( content.toString() ).append( "\n" );
+ }
+
+ private void print( String prefix, Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ sb.append( "[" + prefix + "] " ).append( sWriter.toString() ).append( "\n" );
+ }
+
+ private void print( String prefix, CharSequence content, Throwable error )
+ {
+ StringWriter sWriter = new StringWriter();
+ PrintWriter pWriter = new PrintWriter( sWriter );
+
+ error.printStackTrace( pWriter );
+
+ sb.append( "[" + prefix + "] " ).append( content.toString() ).append( "\n\n" )
+ .append( sWriter.toString() ).append( "\n" );
+ }
+
+ protected String getContent()
+ {
+ return sb.toString();
+ }
+ }
+
+}
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo.java Thu Feb 28 04:22:41 2013
@@ -19,6 +19,8 @@ package org.apache.maven.plugin.dependen
* under the License.
*/
+import org.apache.maven.plugin.MojoFailureException;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
import org.apache.maven.plugin.MojoExecutionException;
@@ -216,7 +218,7 @@ public class TestUnpackDependenciesMojo
}
public void testExcludeTestScope()
- throws IOException
+ throws IOException, MojoFailureException
{
mojo.project.setArtifacts( stubFactory.getScopedArtifacts() );
mojo.project.setDependencyArtifacts( new HashSet<Artifact>() );
@@ -648,7 +650,7 @@ public class TestUnpackDependenciesMojo
public void assertUnpacked( Artifact artifact, boolean overWrite )
- throws InterruptedException, MojoExecutionException
+ throws InterruptedException, MojoExecutionException, MojoFailureException
{
File unpackedFile = getUnpackedFile( artifact );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo2.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo2.java?rev=1451088&r1=1451087&r2=1451088&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo2.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestUnpackDependenciesMojo2.java Thu Feb 28 04:22:41 2013
@@ -19,6 +19,8 @@ package org.apache.maven.plugin.dependen
* under the License.
*/
+import org.apache.maven.plugin.MojoFailureException;
+
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.dependency.testUtils.DependencyArtifactStubFactory;
@@ -93,7 +95,7 @@ public class TestUnpackDependenciesMojo2
}
public void testDontOverWriteRelease()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -113,7 +115,7 @@ public class TestUnpackDependenciesMojo2
}
public void testOverWriteRelease()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -134,7 +136,7 @@ public class TestUnpackDependenciesMojo2
}
public void testDontOverWriteSnap()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -156,7 +158,7 @@ public class TestUnpackDependenciesMojo2
}
public void testOverWriteSnap()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -179,7 +181,7 @@ public class TestUnpackDependenciesMojo2
}
public void testOverWriteIfNewer()
- throws MojoExecutionException, InterruptedException, IOException
+ throws MojoExecutionException, InterruptedException, IOException, MojoFailureException
{
Set<Artifact> artifacts = new HashSet<Artifact>();
@@ -225,7 +227,7 @@ public class TestUnpackDependenciesMojo2
}
public void assertUnpacked( Artifact artifact, boolean overWrite )
- throws InterruptedException, MojoExecutionException
+ throws InterruptedException, MojoExecutionException, MojoFailureException
{
File unpackedFile = getUnpackedFile( artifact );
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml?rev=1451088&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-analyze-report-config.xml Thu Feb 28 04:22:41 2013
@@ -0,0 +1,46 @@
+<?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>com.mycompany.app</groupId>
+ <artifactId>my-mojo</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>my-mojo Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <project implementation="org.apache.maven.plugin.dependency.testUtils.stubs.DuplicateDependenciesProjectStub"/>
+ <skip>true</skip>
+ <outputDirectory>/some/folder</outputDirectory>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-config.xml?rev=1451088&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-config.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-config.xml Thu Feb 28 04:22:41 2013
@@ -0,0 +1,45 @@
+<?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>com.mycompany.app</groupId>
+ <artifactId>my-mojo</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>my-mojo Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <project implementation="org.apache.maven.plugin.dependency.testUtils.stubs.DuplicateDependenciesProjectStub"/>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-get-config.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-get-config.xml?rev=1451088&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-get-config.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/unit/skip-test/plugin-get-config.xml Thu Feb 28 04:22:41 2013
@@ -0,0 +1,44 @@
+<?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>com.mycompany.app</groupId>
+ <artifactId>my-mojo</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>1.0-SNAPSHOT</version>
+
+ <name>my-mojo Maven Mojo</name>
+ <url>http://maven.apache.org</url>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>