You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/10/12 20:28:53 UTC
svn commit: r1397671 - in /maven/plugins/trunk/maven-dependency-plugin/src:
it/copy-cli/ it/unpack-cli/
main/java/org/apache/maven/plugin/dependency/fromConfiguration/
test/java/org/apache/maven/plugin/dependency/fromConfiguration/
Author: rfscholte
Date: Fri Oct 12 18:28:52 2012
New Revision: 1397671
URL: http://svn.apache.org/viewvc?rev=1397671&view=rev
Log:
[MDEP-381] Unpack/copy an artifact from commandline
Added:
maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/
maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/test.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/verify.bsh
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/test.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/verify.bsh
Modified:
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/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/invoker.properties?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/invoker.properties Fri Oct 12 18:28:52 2012
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:copy
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/pom.xml?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/pom.xml Fri Oct 12 18:28:52 2012
@@ -0,0 +1,32 @@
+<?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.plugins.dependency.its</groupId>
+ <artifactId>mdep-381-copy</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+</project>
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/test.properties?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/test.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/test.properties Fri Oct 12 18:28:52 2012
@@ -0,0 +1 @@
+artifact=org.apache.maven:maven-model:2.0.6
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/verify.bsh?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/verify.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/copy-cli/verify.bsh Fri Oct 12 18:28:52 2012
@@ -0,0 +1,19 @@
+import java.io.*;
+
+File libDir = new File( basedir, "target/dependency" );
+
+String[] expectedFiles = {
+ "maven-model-2.0.6.jar",
+};
+
+for ( String expectedFile : expectedFiles )
+{
+ File file = new File( libDir, expectedFile );
+ System.out.println( "Checking for existence of " + file );
+ if ( !file.isFile() )
+ {
+ throw new Exception( "Missing file " + file );
+ }
+}
+
+return true;
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/invoker.properties?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/invoker.properties Fri Oct 12 18:28:52 2012
@@ -0,0 +1,2 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:unpack
+
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/pom.xml?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/pom.xml Fri Oct 12 18:28:52 2012
@@ -0,0 +1,32 @@
+<?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.plugins.dependency.its</groupId>
+ <artifactId>mdep-381-unpack</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+</project>
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/test.properties?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/test.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/test.properties Fri Oct 12 18:28:52 2012
@@ -0,0 +1,2 @@
+artifact=qdox:qdox:1.5:tar.gz:src
+outputDirectory=target/output spaces directory
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/verify.bsh?rev=1397671&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/verify.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/unpack-cli/verify.bsh Fri Oct 12 18:28:52 2012
@@ -0,0 +1,33 @@
+import java.io.*;
+
+
+File file = new File( basedir, "target/output spaces directory" );
+System.out.println( "Checking for existence of " + file );
+if ( !file.isDirectory() )
+{
+ throw new Exception( "Missing " + file );
+}
+
+file = new File( file, "qdox-1.5" );
+System.out.println( "Checking for existence of " + file );
+if ( !file.isDirectory() )
+{
+ throw new Exception( "Missing " + file );
+}
+
+file = new File( file, "build.xml" );
+System.out.println( "Checking for existence of " + file );
+if ( !file.isFile() )
+{
+ throw new Exception( "Missing " + file );
+}
+
+//until MDEP-242 is fixed, the next test will passed
+file = new File( file.getParent(), "src" );
+System.out.println( "Checking for existence of " + file );
+if ( !file.isDirectory() )
+{
+ throw new Exception( "Missing " + file );
+}
+
+return true;
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=1397671&r1=1397670&r2=1397671&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 Fri Oct 12 18:28:52 2012
@@ -20,6 +20,7 @@ package org.apache.maven.plugin.dependen
*/
import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
@@ -28,6 +29,7 @@ import org.apache.maven.artifact.version
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.dependency.AbstractDependencyMojo;
import org.apache.maven.plugin.dependency.utils.DependencyUtil;
import org.apache.maven.plugin.dependency.utils.filters.ArtifactItemFilter;
@@ -105,7 +107,7 @@ public abstract class AbstractFromConfig
*
* @since 1.0
*/
- @Parameter( required = true )
+ @Parameter
private List<ArtifactItem> artifactItems;
/**
@@ -128,7 +130,19 @@ public abstract class AbstractFromConfig
*/
private ArtifactRepository overrideLocalRepository;
+ @Component
+ private ArtifactFactory artifactFactory;
+
abstract ArtifactItemFilter getMarkedArtifactFilter( ArtifactItem item );
+
+ // artifactItems is filled by either field injection or by setArtifact()
+ protected void verifyRequirements() throws MojoFailureException
+ {
+ if ( artifactItems == null || artifactItems.isEmpty() )
+ {
+ throw new MojoFailureException( "Either artifact or artifactItems is required " );
+ }
+ }
/**
* Preprocesses the list of ArtifactItems. This method defaults the outputDirectory if not set and creates the
@@ -524,4 +538,42 @@ public abstract class AbstractFromConfig
{
this.skip = skip;
}
+
+ public void setArtifact( String artifact )
+ throws MojoFailureException
+ {
+ if ( artifact != null )
+ {
+ String packaging = "jar";
+ String classifier;
+ String[] tokens = StringUtils.split( artifact, ":" );
+ if ( tokens.length < 3 || tokens.length > 5 )
+ {
+ throw new MojoFailureException(
+ "Invalid artifact, you must specify groupId:artifactId:version[:packaging][:classifier] "
+ + artifact );
+ }
+ String groupId = tokens[0];
+ String artifactId = tokens[1];
+ String version = tokens[2];
+ if ( tokens.length >= 4 )
+ {
+ packaging = tokens[3];
+ }
+ if ( tokens.length == 5 )
+ {
+ classifier = tokens[4];
+ }
+ else
+ {
+ classifier = null;
+ }
+
+ Artifact toUnpack = classifier == null
+ ? artifactFactory.createBuildArtifact( groupId, artifactId, version, packaging )
+ : artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, classifier );
+
+ setArtifactItems( Collections.singletonList( new ArtifactItem( toUnpack ) ) );
+ }
+ }
}
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=1397671&r1=1397670&r2=1397671&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 Fri Oct 12 18:28:52 2012
@@ -20,6 +20,7 @@ package org.apache.maven.plugin.dependen
*/
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.dependency.utils.filters.ArtifactItemFilter;
import org.apache.maven.plugin.dependency.utils.filters.DestFileFilter;
import org.apache.maven.plugins.annotations.LifecyclePhase;
@@ -36,7 +37,7 @@ import java.util.List;
* @version $Id$
* @since 1.0
*/
-@Mojo( name = "copy", defaultPhase = LifecyclePhase.PROCESS_SOURCES )
+@Mojo( name = "copy", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresProject = false )
public class CopyMojo
extends AbstractFromConfigurationMojo
{
@@ -48,6 +49,14 @@ public class CopyMojo
private boolean stripVersion = false;
/**
+ * The artifact to copy from commandLine.
+ * Use {@link #artifactItems} within the pom-configuration.
+ */
+ @SuppressWarnings( "unused" ) //marker-field, setArtifact(String) does the magic
+ @Parameter( property = "artifact" )
+ private String artifact;
+
+ /**
* Main entry into mojo. This method gets the ArtifactItems and iterates through each one passing it to
* copyArtifact.
*
@@ -57,12 +66,14 @@ public class CopyMojo
* @see #copyArtifact(ArtifactItem)
*/
public void execute()
- throws MojoExecutionException
+ throws MojoExecutionException, MojoFailureException
{
if ( isSkip() )
{
return;
}
+
+ verifyRequirements();
List<ArtifactItem> theArtifactItems = getProcessedArtifactItems( this.stripVersion );
for ( ArtifactItem artifactItem : theArtifactItems )
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=1397671&r1=1397670&r2=1397671&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 Fri Oct 12 18:28:52 2012
@@ -20,6 +20,7 @@ package org.apache.maven.plugin.dependen
*/
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugin.dependency.utils.filters.ArtifactItemFilter;
import org.apache.maven.plugin.dependency.utils.filters.MarkerFileFilter;
import org.apache.maven.plugin.dependency.utils.markers.MarkerHandler;
@@ -39,7 +40,7 @@ import java.util.List;
* @version $Id$
* @since 1.0
*/
-@Mojo( name = "unpack", defaultPhase = LifecyclePhase.PROCESS_SOURCES )
+@Mojo( name = "unpack", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresProject = false )
public final class UnpackMojo
extends AbstractFromConfigurationMojo
{
@@ -71,6 +72,14 @@ public final class UnpackMojo
private String excludes;
/**
+ * The artifact to unpack from commandLine.
+ * Use {@link #artifactItems} within the pom-configuration.
+ */
+ @SuppressWarnings( "unused" ) //marker-field, setArtifact(String) does the magic
+ @Parameter( property = "artifact" )
+ private String artifact;
+
+ /**
* Main entry into mojo. This method gets the ArtifactItems and iterates through each one passing it to
* unpackArtifact.
*
@@ -80,12 +89,14 @@ public final class UnpackMojo
* @see #unpackArtifact(ArtifactItem)
*/
public void execute()
- throws MojoExecutionException
+ throws MojoExecutionException, MojoFailureException
{
if ( isSkip() )
{
return;
}
+
+ verifyRequirements();
List<ArtifactItem> processedItems = getProcessedArtifactItems( false );
for ( ArtifactItem artifactItem : processedItems )
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java?rev=1397671&r1=1397670&r2=1397671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestCopyMojo.java Fri Oct 12 18:28:52 2012
@@ -20,7 +20,6 @@ package org.apache.maven.plugin.dependen
*/
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@@ -122,7 +121,7 @@ public class TestCopyMojo
}
public void testCopyFile()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
@@ -134,7 +133,7 @@ public class TestCopyMojo
}
public void testSkip()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
@@ -152,7 +151,7 @@ public class TestCopyMojo
}
public void testCopyFileNoOverwrite()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
@@ -169,7 +168,7 @@ public class TestCopyMojo
}
public void testCopyToLocation()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
ArtifactItem item = (ArtifactItem) list.get( 0 );
@@ -183,7 +182,7 @@ public class TestCopyMojo
}
public void testCopyStripVersionSetInMojo()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
ArtifactItem item = (ArtifactItem) list.get( 0 );
@@ -199,7 +198,7 @@ public class TestCopyMojo
}
public void testNonClassifierStrip()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getReleaseAndSnapshotArtifacts() );
mojo.setStripVersion( true );
@@ -211,7 +210,7 @@ public class TestCopyMojo
}
public void testNonClassifierNoStrip()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getReleaseAndSnapshotArtifacts() );
@@ -223,7 +222,7 @@ public class TestCopyMojo
}
public void testMissingVersionNotFound()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -271,7 +270,7 @@ public class TestCopyMojo
}
public void testMissingVersionFromDependencies()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -293,7 +292,7 @@ public class TestCopyMojo
}
public void testMissingVersionFromDependenciesLooseMatch()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -318,7 +317,7 @@ public class TestCopyMojo
}
public void testMissingVersionFromDependenciesWithClassifier()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -363,7 +362,7 @@ public class TestCopyMojo
}
public void testMissingVersionFromDependencyMgt()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -396,7 +395,7 @@ public class TestCopyMojo
}
public void testMissingVersionFromDependencyMgtLooseMatch()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -430,7 +429,7 @@ public class TestCopyMojo
}
public void testMissingVersionFromDependencyMgtWithClassifier()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -527,7 +526,7 @@ public class TestCopyMojo
}
public void testCopyDontOverWriteReleases()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact release = stubFactory.getReleaseArtifact();
@@ -558,7 +557,7 @@ public class TestCopyMojo
}
public void testCopyDontOverWriteSnapshots()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact artifact = stubFactory.getSnapshotArtifact();
@@ -589,7 +588,7 @@ public class TestCopyMojo
}
public void testCopyOverWriteReleases()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact release = stubFactory.getReleaseArtifact();
@@ -617,7 +616,7 @@ public class TestCopyMojo
}
public void testCopyOverWriteSnapshot()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact artifact = stubFactory.getSnapshotArtifact();
@@ -646,7 +645,7 @@ public class TestCopyMojo
}
public void testCopyOverWriteIfNewer()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact artifact = stubFactory.getSnapshotArtifact();
@@ -675,7 +674,7 @@ public class TestCopyMojo
}
public void testCopyFileWithOverideLocalRepo()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java?rev=1397671&r1=1397670&r2=1397671&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/fromConfiguration/TestUnpackMojo.java Fri Oct 12 18:28:52 2012
@@ -132,7 +132,7 @@ public class TestUnpackMojo
}
public void testUnpackFile()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
@@ -144,7 +144,7 @@ public class TestUnpackMojo
}
public void testSkip()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
@@ -157,7 +157,7 @@ public class TestUnpackMojo
}
public void testUnpackToLocation()
- throws IOException, MojoExecutionException
+ throws Exception
{
List<ArtifactItem> list = stubFactory.getArtifactItems( stubFactory.getClassifiedArtifacts() );
ArtifactItem item = (ArtifactItem) list.get( 0 );
@@ -171,7 +171,7 @@ public class TestUnpackMojo
}
public void testMissingVersionNotFound()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -219,7 +219,7 @@ public class TestUnpackMojo
}
public void testMissingVersionFromDependencies()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -241,7 +241,7 @@ public class TestUnpackMojo
}
public void testMissingVersionFromDependenciesWithClassifier()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -286,7 +286,7 @@ public class TestUnpackMojo
}
public void testMissingVersionFromDependencyMgt()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -318,7 +318,7 @@ public class TestUnpackMojo
}
public void testMissingVersionFromDependencyMgtWithClassifier()
- throws MojoExecutionException
+ throws Exception
{
ArtifactItem item = new ArtifactItem();
@@ -415,7 +415,7 @@ public class TestUnpackMojo
}
public void testUnpackDontOverWriteReleases()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact release = stubFactory.getReleaseArtifact();
@@ -435,7 +435,7 @@ public class TestUnpackMojo
}
public void testUnpackDontOverWriteSnapshots()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact artifact = stubFactory.getSnapshotArtifact();
@@ -455,7 +455,7 @@ public class TestUnpackMojo
}
public void testUnpackOverWriteReleases()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact release = stubFactory.getReleaseArtifact();
@@ -475,7 +475,7 @@ public class TestUnpackMojo
}
public void testUnpackOverWriteSnapshot()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
stubFactory.setCreateFiles( true );
Artifact artifact = stubFactory.getSnapshotArtifact();
@@ -496,7 +496,7 @@ public class TestUnpackMojo
}
public void testUnpackOverWriteIfNewer()
- throws IOException, MojoExecutionException, InterruptedException
+ throws Exception
{
final long now = System.currentTimeMillis();
@@ -548,7 +548,7 @@ public class TestUnpackMojo
}
public void assertUnpacked( ArtifactItem item, boolean overWrite )
- throws InterruptedException, MojoExecutionException
+ throws Exception
{
File unpackedFile = getUnpackedFile( item );