Author: rfscholte Date: Sat Jun 20 19:44:27 2015 New Revision: 1686668 URL: http://svn.apache.org/r1686668 Log: [MDEP-495] Remove deprecated parameter removed destination from 'get' goal
Modified: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/GetMojo.java maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java 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=1686668&r1=1686667&r2=1686668&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 Sat Jun 20 19:44:27 2015 @@ -19,7 +19,14 @@ package org.apache.maven.plugin.dependen * under the License. */ -import org.apache.commons.io.FileUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.factory.ArtifactFactory; import org.apache.maven.artifact.metadata.ArtifactMetadataSource; @@ -37,16 +44,6 @@ import org.apache.maven.plugins.annotati import org.apache.maven.plugins.annotations.Parameter; import org.codehaus.plexus.util.StringUtils; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - /** * Resolves a single artifact, eventually transitively, from the specified remote repositories. * Caveat: will always check thecentral repository defined in the super pom. You could use a mirror entry in your @@ -140,15 +137,6 @@ public class GetMojo private String artifact; /** - * The destination file or directory to copy the artifact to, if other than the local repository - * - * @since 2.4 - * @deprecated if you need to copy the resolved artifact, use dependency:copy - */ - @Parameter( property = "dest" ) - private String destination; - - /** * */ @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true ) @@ -253,38 +241,6 @@ public class GetMojo { throw new MojoExecutionException( "Couldn't download artifact: " + e.getMessage(), e ); } - - if ( destination != null ) - { - getLog().warn( "destination/dest parameter is deprecated: it will disappear in future version." ); - - File src = toDownload.getFile(); - File dest = new File( destination ); - - getLog().info( "Copying " + src.getAbsolutePath() + " to " + dest.getAbsolutePath() ); - if ( transitive ) - { - getLog().warn( "Notice transitive dependencies won't be copied." ); - } - - try - { - if ( dest.isDirectory() ) - { - FileUtils.copyFileToDirectory( src, dest ); - } - else - { - FileUtils.copyFile( src, dest ); - } - } - catch ( IOException e ) - { - throw new MojoExecutionException( - "Couldn't copy downloaded artifact from " + src.getAbsolutePath() + " to " + dest.getAbsolutePath() - + " : " + e.getMessage(), e ); - } - } } ArtifactRepository parseRepository( String repo, ArtifactRepositoryPolicy policy ) Modified: maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java?rev=1686668&r1=1686667&r2=1686668&view=diff ============================================================================== --- maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java (original) +++ maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/TestGetMojo.java Sat Jun 20 19:44:27 2015 @@ -99,39 +99,6 @@ public class TestGetMojo } /** - * Test destination parameter - * - * @throws Exception - */ - public void testDestination() - throws Exception - { - // Set properties, transitive = default value = true - setVariableValueToObject( mojo, "transitive", Boolean.FALSE ); - setVariableValueToObject( mojo, "remoteRepositories", "central::default::http://repo1.maven.apache.org/maven2" ); - setVariableValueToObject( mojo, "groupId", "org.apache.maven" ); - setVariableValueToObject( mojo, "artifactId", "maven-model" ); - setVariableValueToObject( mojo, "version", "2.0.9" ); - File output = new File( getBasedir(), "target/unit-tests/get-test/destination-file/maven-model-2.0.9.jar" ); - output.delete(); - setVariableValueToObject( mojo, "destination", output.getAbsolutePath() ); - - mojo.execute(); - assertTrue( output.exists() ); - - // Test directory - output = new File( getBasedir(), "target/unit-tests/get-test/destination-dir" ); - output.mkdirs(); - FileUtils.cleanDirectory( output ); - setVariableValueToObject( mojo, "destination", output.getAbsolutePath() ); - - mojo.execute(); - assertTrue( new File( output, "org.apache.maven_maven-model-2.0.9.jar" ).exists() ); - } - - - - /** * Test remote repositories parameter * * @throws Exception