You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by pg...@apache.org on 2012/10/22 06:10:31 UTC
svn commit: r1400760 - in /maven/plugins/trunk/maven-dependency-plugin: ./
src/it/ src/it/purge-local-repository-bad-pom/
src/it/purge-local-repository-manual-include/
src/it/purge-local-repository-non-transitive/
src/it/purge-local-repository-reresolv...
Author: pgier
Date: Mon Oct 22 04:10:29 2012
New Revision: 1400760
URL: http://svn.apache.org/viewvc?rev=1400760&view=rev
Log:
[MDEP-272] Refactoring of purge-local-repository goal to allow for version ranges and better error handling. Added new ITs for purge-local-repository.
Added:
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/bad-pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/setup.bsh
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/test.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/verify.bsh
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/test.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/verify.bsh
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/verify.bsh
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/invoker.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/test.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/verify.bsh
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar.sha1
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom.sha1
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml.sha1
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar.sha1
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom.sha1
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml
maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml.sha1
Modified:
maven/plugins/trunk/maven-dependency-plugin/pom.xml
maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-manual-include/verify.bsh
maven/plugins/trunk/maven-dependency-plugin/src/it/settings.xml
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/PurgeLocalRepositoryMojo.java
Modified: maven/plugins/trunk/maven-dependency-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/pom.xml?rev=1400760&r1=1400759&r2=1400760&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-dependency-plugin/pom.xml Mon Oct 22 04:10:29 2012
@@ -311,6 +311,10 @@ under the License.
<postBuildHookScript>verify</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
+ <pomExcludes>
+ <!-- Exclude this IT until it can be fixed -->
+ <pomExclude>purge-local-repository-bad-pom/pom.xml</pomExclude>
+ </pomExcludes>
<goals>
<goal>clean</goal>
<goal>process-sources</goal>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/bad-pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/bad-pom.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/bad-pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/bad-pom.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,47 @@
+<?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>purge-local-repository</artifactId>
+ <version>1.0</version>
+
+ <name>Test</name>
+ <description>
+ Test dependency:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository-2</artifactId>
+ <version>1.0-junk</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/invoker.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/invoker.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:purge-local-repository
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/pom.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/pom.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,47 @@
+<?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:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/setup.bsh?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/setup.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/setup.bsh Mon Oct 22 04:10:29 2012
@@ -0,0 +1,16 @@
+import java.io.*;
+
+File localRepoDir = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/" );
+localRepoDir.mkdirs();
+
+File badPomSrc = new File( basedir, "bad-pom.xml" );
+File badPomDest = new File( localRepoDir, "purge-local-repository-1.0.pom" );
+
+System.out.println( "Moving bad pom: " + badPomSrc );
+if ( ! badPomSrc.renameTo( badPomDest ) )
+{
+ System.out.println( "Unable to move file: " + badPomSrc );
+}
+System.out.println( "Moved to: " + badPomDest );
+
+return true;
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/test.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/test.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/test.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1,2 @@
+actTransitively = true
+reResolve = true
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/verify.bsh?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/verify.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-bad-pom/verify.bsh Mon Oct 22 04:10:29 2012
@@ -0,0 +1,33 @@
+import java.io.*;
+
+System.out.println( "Checking for presence of purged dependency directories" );
+
+File depJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar" );
+
+if ( !depJar.exists() )
+{
+ throw new Exception( "Direct dependency jar was not re-resolved: " + depJar );
+}
+
+File depPom = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom" );
+
+if ( !depPom.exists() )
+{
+ throw new Exception( "Direct dependency pom was not re-resolved: " + depPom );
+}
+
+File transitiveDepJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar" );
+
+if ( !transitiveDepJar.exists() )
+{
+ throw new Exception( "Transitive dep jar was not re-resolved: " + transitiveDepJar );
+}
+
+File transitiveDepPom = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom" );
+
+if ( !transitiveDepPom.exists() )
+{
+ throw new Exception( "Transitive dep pom was not re-resolved: " + transitiveDepPom );
+}
+
+return true;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-manual-include/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-manual-include/verify.bsh?rev=1400760&r1=1400759&r2=1400760&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-manual-include/verify.bsh (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-manual-include/verify.bsh Mon Oct 22 04:10:29 2012
@@ -4,9 +4,10 @@ File purgedJar = new File( localReposito
System.out.println( "Checking for absence of dummy JAR " + purgedJar );
-if ( purgedJar.exists() )
+if ( purgedJar.getParentFile().exists() )
{
- throw new Exception( "JAR was not purged: " + purgedJar );
+ throw new Exception( "Directory was not purged: " + purgedJar.getParentFile() );
}
return true;
+
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/invoker.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/invoker.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:resolve ${project.groupId}:${project.artifactId}:${project.version}:purge-local-repository
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/pom.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/pom.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,47 @@
+<?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:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/test.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/test.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/test.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1,2 @@
+reResolve = false
+actTransitively = false
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/verify.bsh?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/verify.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-non-transitive/verify.bsh Mon Oct 22 04:10:29 2012
@@ -0,0 +1,19 @@
+import java.io.*;
+
+File depDir = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0" );
+
+System.out.println( "Checking for absence of purged dependency directory " + depDir );
+
+if ( depDir.exists() )
+{
+ throw new Exception( "Directory was not deleted: " + purgedDir );
+}
+
+File transitiveDepDir = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0" );
+
+if ( !transitiveDepDir.exists() )
+{
+ throw new Exception( "Transitive dep was purged: " + transitiveDepDir );
+}
+
+return true;
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/invoker.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/invoker.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:purge-local-repository
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/pom.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/pom.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,47 @@
+<?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:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/verify.bsh?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/verify.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-reresolve/verify.bsh Mon Oct 22 04:10:29 2012
@@ -0,0 +1,33 @@
+import java.io.*;
+
+System.out.println( "Checking for presence of purged dependency directories" );
+
+File depJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar" );
+
+if ( !depJar.exists() )
+{
+ throw new Exception( "Direct dependency jar was not re-resolved: " + depJar );
+}
+
+File depPom = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom" );
+
+if ( !depPom.exists() )
+{
+ throw new Exception( "Direct dependency pom was not re-resolved: " + depPom );
+}
+
+File transitiveDepJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar" );
+
+if ( !transitiveDepJar.exists() )
+{
+ throw new Exception( "Transitive dep jar was not re-resolved: " + transitiveDepJar );
+}
+
+File transitiveDepPom = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom" );
+
+if ( !transitiveDepPom.exists() )
+{
+ throw new Exception( "Transitive dep pom was not re-resolved: " + transitiveDepPom );
+}
+
+return true;
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/invoker.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/invoker.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/invoker.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:purge-local-repository
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/pom.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/pom.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,47 @@
+<?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:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository</artifactId>
+ <version>[0.9, 1.1]</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/test.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/test.properties?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/test.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/test.properties Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+reResolve = true
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/verify.bsh?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/verify.bsh (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/purge-local-repository-version-range/verify.bsh Mon Oct 22 04:10:29 2012
@@ -0,0 +1,33 @@
+import java.io.*;
+
+System.out.println( "Checking for presence of purged dependency directories" );
+
+File depJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar" );
+
+if ( !depJar.exists() )
+{
+ throw new Exception( "Direct dependency jar was not re-resolved: " + depJar );
+}
+
+File depPom = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom" );
+
+if ( !depPom.exists() )
+{
+ throw new Exception( "Direct dependency pom was not re-resolved: " + depPom );
+}
+
+File transitiveDepJar = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar" );
+
+if ( !transitiveDepJar.exists() )
+{
+ throw new Exception( "Transitive dep jar was not re-resolved: " + transitiveDepJar );
+}
+
+File transitiveDepPom = new File( localRepositoryPath, "org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom" );
+
+if ( !transitiveDepPom.exists() )
+{
+ throw new Exception( "Transitive dep pom was not re-resolved: " + transitiveDepPom );
+}
+
+return true;
Modified: maven/plugins/trunk/maven-dependency-plugin/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/it/settings.xml?rev=1400760&r1=1400759&r2=1400760&view=diff
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/settings.xml (original)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/settings.xml Mon Oct 22 04:10:29 2012
@@ -51,5 +51,23 @@ under the License.
</pluginRepository>
</pluginRepositories>
</profile>
+ <profile>
+ <id>file-system-test-repo</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <repositories>
+ <repository>
+ <id>file-system-test-repo</id>
+ <url>@baseurl@/src/test/resources/m2repo</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ </profile>
</profiles>
</settings>
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=1400760&r1=1400759&r2=1400760&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 Mon Oct 22 04:10:29 2012
@@ -20,15 +20,17 @@ package org.apache.maven.plugin.dependen
*/
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.AbstractMojo;
@@ -38,6 +40,8 @@ import org.apache.maven.plugins.annotati
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.artifact.filter.PatternExcludesArtifactFilter;
+import org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
@@ -45,18 +49,15 @@ import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
-import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
-import java.util.Map;
import java.util.Set;
/**
- * Remove the project dependencies from the local repository, and optionally
- * re-resolve them.
- *
+ * Remove the project dependencies from the local repository, and optionally re-resolve them.
+ *
* @author jdcasey
* @version $Id$
* @since 2.0
@@ -75,21 +76,16 @@ public class PurgeLocalRepositoryMojo
public static final String GROUP_ID_FUZZINESS = "groupId";
/**
- * The projects in the current build. Each of these is subject to
- * refreshing.
+ * The projects in the current build. Each of these is subject to refreshing.
*/
@Parameter( defaultValue = "${reactorProjects}", readonly = true, required = true )
private List<MavenProject> projects;
/**
- * The list of dependencies in the form of groupId:artifactId which should
- * BE deleted/purged from the local repository. Note that using this
- * parameter will deactivate the normal process for purging the current project
- * dependency tree. If this parameter is used, only the included artifacts will
- * be purged.
- *
- * The manualIncludes parameter should not be used in combination with the
- * includes/excludes parameters.
+ * The list of dependencies in the form of groupId:artifactId which should BE deleted/purged from the local
+ * repository. Note that using this parameter will deactivate the normal process for purging the current project
+ * dependency tree. If this parameter is used, only the included artifacts will be purged. The manualIncludes
+ * parameter should not be used in combination with the includes/excludes parameters.
*
* @since 2.6
*/
@@ -97,10 +93,9 @@ public class PurgeLocalRepositoryMojo
private List<String> manualIncludes;
/**
- * Comma-separated list of groupId:artifactId entries, which should be used
- * to manually include artifacts for deletion. This is a command-line
- * alternative to the <code>manualIncludes</code> parameter, since List
- * parameters are not currently compatible with CLI specification.
+ * Comma-separated list of groupId:artifactId entries, which should be used to manually include artifacts for
+ * deletion. This is a command-line alternative to the <code>manualIncludes</code> parameter, since List parameters
+ * are not currently compatible with CLI specification.
*
* @since 2.6
*/
@@ -108,8 +103,7 @@ public class PurgeLocalRepositoryMojo
private String manualInclude;
/**
- * The list of dependencies in the form of groupId:artifactId which should
- * BE deleted/refreshed.
+ * The list of dependencies in the form of groupId:artifactId which should BE deleted/refreshed.
*
* @since 2.6
*/
@@ -117,9 +111,8 @@ public class PurgeLocalRepositoryMojo
private List<String> includes;
/**
- * Comma-separated list of groupId:artifactId entries, which should be used
- * to include artifacts for deletion/refresh. This is a command-line
- * alternative to the <code>includes</code> parameter, since List
+ * Comma-separated list of groupId:artifactId entries, which should be used to include artifacts for
+ * deletion/refresh. This is a command-line alternative to the <code>includes</code> parameter, since List
* parameters are not currently compatible with CLI specification.
*
* @since 2.6
@@ -128,25 +121,22 @@ public class PurgeLocalRepositoryMojo
private String include;
/**
- * The list of dependencies in the form of groupId:artifactId which should
- * NOT be deleted/refreshed.
+ * The list of dependencies in the form of groupId:artifactId which should NOT be deleted/refreshed.
*/
@Parameter
private List<String> excludes;
/**
- * Comma-separated list of groupId:artifactId entries, which should be used
- * to exclude artifacts from deletion/refresh. This is a command-line
- * alternative to the <code>excludes</code> parameter, since List
+ * Comma-separated list of groupId:artifactId entries, which should be used to exclude artifacts from
+ * deletion/refresh. This is a command-line alternative to the <code>excludes</code> parameter, since List
* parameters are not currently compatible with CLI specification.
*/
@Parameter( property = "exclude" )
private String exclude;
/**
- * Whether to re-resolve the artifacts once they have been deleted from the
- * local repository. If you are running this mojo from the command-line, you
- * may want to disable this. By default, artifacts will be re-resolved.
+ * Whether to re-resolve the artifacts once they have been deleted from the local repository. If you are running
+ * this mojo from the command-line, you may want to disable this. By default, artifacts will be re-resolved.
*/
@Parameter( property = "reResolve", defaultValue = "true" )
private boolean reResolve;
@@ -164,8 +154,7 @@ public class PurgeLocalRepositoryMojo
protected List<ArtifactRepository> remoteRepos;
/**
- * The artifact resolver used to re-resolve dependencies, if that option is
- * enabled.
+ * The artifact resolver used to re-resolve dependencies, if that option is enabled.
*/
@Component
private ArtifactResolver resolver;
@@ -174,27 +163,28 @@ public class PurgeLocalRepositoryMojo
* The artifact metadata source used to resolve dependencies
*/
@Component
- private ArtifactMetadataSource source;
+ private ArtifactMetadataSource metadataSource;
+
+ /**
+ * The artifact resolution listener used to resolve ranges
+ */
+ // @Component
+ // private ResolutionListener listener;
/**
- * Determines how liberally the plugin will delete an artifact from the
- * local repository. Values are: <br/>
+ * Determines how liberally the plugin will delete an artifact from the local repository. Values are: <br/>
* <ul>
* <li><b>file</b> - Eliminate only the artifact's file.</li>
- * <li><b>version</b> <i>(default)</i> - Eliminate all files associated
- * with the version of the artifact.</li>
- * <li><b>artifactId</b> - Eliminate all files associated with the
- * artifact's artifactId.</li>
- * <li><b>groupId</b> - Eliminate all files associated with the artifact's
- * groupId.</li>
+ * <li><b>version</b> <i>(default)</i> - Eliminate all files associated with the version of the artifact.</li>
+ * <li><b>artifactId</b> - Eliminate all files associated with the artifact's artifactId.</li>
+ * <li><b>groupId</b> - Eliminate all files associated with the artifact's groupId.</li>
* </ul>
*/
@Parameter( property = "resolutionFuzziness", defaultValue = "version" )
private String resolutionFuzziness;
/**
- * Whether this mojo should act on all transitive dependencies. Default
- * value is true.
+ * Whether this mojo should act on all transitive dependencies. Default value is true.
*/
@Parameter( property = "actTransitively", defaultValue = "true" )
private boolean actTransitively;
@@ -213,63 +203,149 @@ public class PurgeLocalRepositoryMojo
/**
* Whether to purge only snapshot artifacts.
- *
+ *
* @since 2.4
*/
@Parameter( property = "snapshotsOnly", defaultValue = "false" )
private boolean snapshotsOnly;
-
public void execute()
throws MojoExecutionException, MojoFailureException
{
+ if ( !StringUtils.isEmpty( manualInclude ) )
+ {
+ manualIncludes = this.parseIncludes( manualInclude );
+ }
- List<String> manualInclusionPatterns = buildInclusionPatternsList( manualIncludes, manualInclude );
-
- if ( manualInclusionPatterns.size() > 0 )
+ // If it's a manual purge, the only step is to delete from the local repo
+ if ( manualIncludes != null && manualIncludes.size() > 0 )
{
- manualPurge( manualInclusionPatterns );
+ manualPurge( manualIncludes );
return;
}
- List<String> inclusionPatterns = buildInclusionPatternsList(includes, include);
-
- List<String> exclusionPatterns = buildInclusionPatternsList(excludes, exclude);
+ ArtifactFilter artifactFilter = createPurgeArtifactsFilter();
for ( MavenProject project : projects )
{
- try
+ Set<Artifact> unresolvedArtifacts = getProjectArtifacts( project );
+ Set<Artifact> resolvedArtifactsToPurge =
+ getFilteredResolvedArtifacts( project, unresolvedArtifacts, artifactFilter );
+
+ if ( resolvedArtifactsToPurge.isEmpty() )
{
- refreshDependenciesForProject( project, inclusionPatterns, exclusionPatterns );
+ getLog().info( "No artifacts included for purge for project: " + project.getId() );
+ continue;
}
- catch ( ArtifactResolutionException e )
+
+ verbose( "Purging dependencies for project: " + project.getId() );
+ purgeArtifacts( resolvedArtifactsToPurge );
+
+ if ( this.reResolve )
{
- MojoFailureException failure =
- new MojoFailureException( this, "Failed to refresh project dependencies for: " + project.getId(),
- "Artifact resolution failed for project: " + project.getId() );
- failure.initCause( e );
+ try
+ {
+ this.reResolveArtifacts( project, resolvedArtifactsToPurge, artifactFilter );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ String failureMessage = "Failed to refresh project dependencies for: " + project.getId();
+ MojoFailureException failure = new MojoFailureException( failureMessage );
+ failure.initCause( e );
- throw failure;
+ throw failure;
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ String failureMessage = "Failed to refresh project dependencies for: " + project.getId();
+ MojoFailureException failure = new MojoFailureException( failureMessage );
+ failure.initCause( e );
+
+ throw failure;
+ }
+ }
+ }
+ }
+
+ private class SystemScopeExcludeFilter
+ implements ArtifactFilter
+ {
+ public boolean include( Artifact artifact )
+ {
+ if ( Artifact.SCOPE_SYSTEM.equals( artifact.getScope() ) )
+ {
+ return false;
+ }
+ else
+ {
+ return true;
}
}
}
+ private class SnapshotsFilter
+ implements ArtifactFilter
+ {
+ public boolean include( Artifact artifact )
+ {
+ return artifact.isSnapshot();
+ }
+ }
+
/**
- * Purge artifacts from the local repository according to the given patterns.
+ * Create the includes exclude filter to use when resolving and purging dependencies Also excludes any "system"
+ * scope dependencies
+ */
+ private ArtifactFilter createPurgeArtifactsFilter()
+ {
+ AndArtifactFilter andFilter = new AndArtifactFilter();
+
+ // System dependencies should never be purged
+ andFilter.add( new SystemScopeExcludeFilter() );
+
+ if ( this.snapshotsOnly )
+ {
+ andFilter.add( new SnapshotsFilter() );
+ }
+
+ // The CLI includes/excludes overrides configuration in the pom
+ if ( !StringUtils.isEmpty( this.include ) )
+ {
+ this.includes = parseIncludes( this.include );
+ }
+ if ( !StringUtils.isEmpty( this.exclude ) )
+ {
+ this.excludes = parseIncludes( this.exclude );
+ }
+
+ if ( this.includes != null )
+ {
+ andFilter.add( new PatternIncludesArtifactFilter( includes ) );
+ }
+ if ( this.excludes != null )
+ {
+ andFilter.add( new PatternExcludesArtifactFilter( excludes ) );
+ }
+
+ return andFilter;
+ }
+
+ /**
+ * Purge/Delete artifacts from the local repository according to the given patterns.
*
* @param inclusionPatterns
* @throws MojoExecutionException
*/
- private void manualPurge( List<String> inclusionPatterns )
+ private void manualPurge( List<String> includes )
throws MojoExecutionException
{
- for ( String pattern : inclusionPatterns )
+ for ( String pattern : includes )
{
if ( StringUtils.isEmpty( pattern ) )
{
throw new MojoExecutionException( "The groupId:artifactId for manualIncludes cannot be empty" );
}
- String relativePath = gaStringtoPath( pattern );
+ String relativePath = groupIdArtifactIdtoPath( pattern );
File purgeDir = new File( localRepository.getBasedir(), relativePath );
if ( purgeDir.exists() )
{
@@ -292,70 +368,87 @@ public class PurgeLocalRepositoryMojo
* @param ga
* @return
*/
- private String gaStringtoPath( String ga )
+ private String groupIdArtifactIdtoPath( String groupIdArtifactId )
{
- if ( ga == null || ga.equals( "" ) )
+ if ( StringUtils.isEmpty( groupIdArtifactId ) )
{
return null;
}
- // Replace wildcard with empty path
- String path = ga.replace( ":*", "" );
- path = path.replace( '.', '/' ).replace( ':', '/' );
- return path;
+ String[] pathComponents = groupIdArtifactId.split( ":" );
+ String groupIdPath = groupIdToPath( pathComponents[0] );
+
+ if ( pathComponents.length == 1 || pathComponents[1] == "*" )
+ {
+ return groupIdPath;
+ }
+ else
+ {
+ return groupIdPath + "/" + pathComponents[1];
+ }
}
- private List<String> buildInclusionPatternsList(List<String> includes, String include)
+ private String groupIdToPath( String groupId )
{
- List<String> patterns = new ArrayList<String>();
+ return groupId.replace( '.', '/' );
+ }
- if ( include != null )
- {
- String[] elements = include.split( " ?, ?" );
+ /**
+ * Convert comma separated list of includes to List object
+ *
+ * @param include
+ * @return the includes list
+ */
+ private List<String> parseIncludes( String include )
+ {
+ List<String> includes = new ArrayList<String>();
- patterns.addAll( Arrays.asList( elements ) );
- }
- else if ( includes != null && !includes.isEmpty() )
+ if ( include != null )
{
- patterns.addAll( includes );
+ String[] elements = include.split( "," );
+ includes.addAll( Arrays.asList( elements ) );
}
- return patterns;
+ return includes;
}
/**
- * Map the groupId:artifactId identifiers to the artifact objects for the current project
- * @param project The current Maven project
- * @return
+ * Get the unresolved project artifacts using the list of dependencies of a project
+ *
+ * @throws ArtifactMetadataRetrievalException
*/
- private Map<String, Artifact> createProjectArtifactMap( MavenProject project )
+ private Set<Artifact> getProjectArtifacts( MavenProject project )
{
- Map<String, Artifact> artifactMap = Collections.emptyMap();
-
- @SuppressWarnings( "unchecked" ) List<Dependency> dependencies = project.getDependencies();
+ @SuppressWarnings( "unchecked" )
+ List<Dependency> dependencies = project.getDependencies();
- Set<Artifact> dependencyArtifacts = new HashSet<Artifact>();
+ Set<Artifact> artifacts = new HashSet<Artifact>();
for ( Dependency dependency : dependencies )
{
- if ( Artifact.SCOPE_SYSTEM.equals( dependency.getScope() ))
+ try
{
- // Don't try to purge system dependencies
- continue;
- }
-
- VersionRange vr = VersionRange.createFromVersion( dependency.getVersion() );
+ VersionRange vr = VersionRange.createFromVersionSpec( dependency.getVersion() );
+ Artifact artifact =
+ factory.createDependencyArtifact( dependency.getGroupId(), dependency.getArtifactId(), vr,
+ dependency.getType(), dependency.getClassifier(),
+ dependency.getScope(), dependency.isOptional() );
- Artifact artifact =
- factory.createDependencyArtifact( dependency.getGroupId(), dependency.getArtifactId(), vr,
- dependency.getType(), dependency.getClassifier(),
- dependency.getScope() );
- if ( snapshotsOnly && !artifact.isSnapshot() )
+ artifacts.add( artifact );
+ }
+ catch ( InvalidVersionSpecificationException e )
{
+ getLog().warn( "Invalid version in pom: " + e );
continue;
}
- dependencyArtifacts.add( artifact );
+
}
+ return artifacts;
+ }
+
+ private Set<Artifact> getFilteredResolvedArtifacts( MavenProject project, Set<Artifact> artifacts,
+ ArtifactFilter artifactFilter )
+ {
// If the transitive dependencies are included, it's necessary to resolve the
// dependencies, even if that means going to the remote repository, to make
// sure we get the full tree.
@@ -363,152 +456,49 @@ public class PurgeLocalRepositoryMojo
{
try
{
- ArtifactResolutionResult result;
+ ArtifactResolutionResult result =
+ resolver.resolveTransitively( artifacts, project.getArtifact(), project.getManagedVersionMap(),
+ localRepository, remoteRepos, metadataSource, artifactFilter,
+ Collections.emptyList() );
- if ( snapshotsOnly )
- {
- result = resolver.resolveTransitively( dependencyArtifacts, project.getArtifact(), localRepository,
- remoteRepos, source, new ArtifactFilter()
- {
- public boolean include( Artifact artifact )
- {
- return artifact.isSnapshot();
- }
- } );
- }
- else
- {
- result =
- resolver.resolveTransitively( dependencyArtifacts, project.getArtifact(), remoteRepos,
- localRepository, source );
- }
+ @SuppressWarnings( "unchecked" )
+ Set<Artifact> resolvedArtifacts = result.getArtifacts();
- artifactMap = ArtifactUtils.artifactMapByVersionlessId( result.getArtifacts() );
+ return resolvedArtifacts;
}
catch ( ArtifactResolutionException e )
{
- verbose( "Skipping: " + e.getArtifactId() + ". It cannot be resolved." );
+ getLog().warn( "Unable to resolve dependencies for : " + e.getGroupId() + ":" + e.getArtifactId() + ":"
+ + e.getVersion() + ". Falling back to non-transitive mode for artifact purge." );
}
catch ( ArtifactNotFoundException e )
{
- verbose( "Skipping: " + e.getArtifactId() + ". It cannot be resolved." );
+ getLog().warn( "Unable to resolve dependencies for: " + e.getGroupId() + ":" + e.getArtifactId() + ":"
+ + e.getVersion() + ". Falling back to non-transitive mode for artifact purge." );
}
}
+
// If we don't care about transitive dependencies, there is no need to resolve
- // from the remote repositories, we can just use the local path
- else
+ // from the remote repositories, we can just set the local path
+ Set<Artifact> artifactSet = new HashSet<Artifact>();
+ for ( Artifact artifact : artifacts )
{
- artifactMap = new HashMap<String, Artifact>();
- for ( Artifact artifact : dependencyArtifacts )
+ if ( artifactFilter.include( artifact ) )
{
- String localPath = localRepository.pathOf( artifact );
+ String localPath = localRepository.pathOf( artifact );
artifact.setFile( new File( localRepository.getBasedir(), localPath ) );
- artifactMap.put( ArtifactUtils.versionlessKey( artifact ), artifact );
+ artifactSet.add( artifact );
}
}
-
- return artifactMap;
- }
-
- private void verbose( String message )
- {
- if ( verbose || getLog().isDebugEnabled() )
- {
- getLog().info( message );
- }
+ return artifactSet;
}
- private void refreshDependenciesForProject( MavenProject project, List<String> inclusionPatterns, List<String> exclusionPatterns )
- throws ArtifactResolutionException, MojoFailureException
+ private void purgeArtifacts( Set<Artifact> artifacts )
+ throws MojoFailureException
{
- Map<String, Artifact> artifactMap = createProjectArtifactMap( project );
-
- if ( artifactMap.isEmpty() )
- {
- getLog().info( "Nothing to do for project: " + project.getId() );
- return;
- }
-
- Map<String, Artifact> depsAfterInclusion = new HashMap<String, Artifact>();
-
- if ( !inclusionPatterns.isEmpty() )
- {
- for ( Iterator<Map.Entry<String, Artifact>> artifactIter = artifactMap.entrySet().iterator(); artifactIter.hasNext(); )
- {
- Map.Entry<String, Artifact> artifactEntry = artifactIter.next();
-
- Artifact artifact = artifactEntry.getValue();
-
- if ( resolutionFuzziness.equals( GROUP_ID_FUZZINESS ) )
- {
- if ( inclusionPatterns.contains( artifact.getGroupId() ) )
- {
- verbose( "Including groupId: " + artifact.getGroupId() + " for refresh operation for project: "
- + project.getId() );
- depsAfterInclusion.put( artifactEntry.getKey(), artifactEntry.getValue() );
- }
- }
- else
- {
- String artifactKey = ArtifactUtils.versionlessKey( artifact );
- if ( inclusionPatterns.contains( artifactKey ) )
- {
- verbose( "Including artifact: " + artifactKey + " for refresh operation for project: "
- + project.getId() );
- depsAfterInclusion.put( artifactEntry.getKey(), artifactEntry.getValue() );
- }
- }
- }
-
- if ( depsAfterInclusion.isEmpty() )
- {
- getLog().info( "Nothing to include for project: " + project.getId() + ". Ending purge." );
- return;
- }
-
- // replacing deps by the one included in order to apply the exclusion pattern.
- artifactMap = depsAfterInclusion;
- }
-
- if ( !exclusionPatterns.isEmpty() )
- {
- for ( String excludedKey : exclusionPatterns )
- {
- if ( resolutionFuzziness.equals( GROUP_ID_FUZZINESS ) )
- {
- verbose( "Excluding groupId: " + excludedKey + " from refresh operation for project: "
- + project.getId() );
-
- for ( Iterator<Map.Entry<String, Artifact>> artifactIter = artifactMap.entrySet().iterator();
- artifactIter.hasNext(); )
- {
- Map.Entry<String, Artifact> artifactEntry = artifactIter.next();
-
- Artifact artifact = artifactEntry.getValue();
-
- if ( artifact.getGroupId().equals( excludedKey ) )
- {
- artifactIter.remove();
- }
- }
- }
- else
- {
- verbose( "Excluding: " + excludedKey + " from refresh operation for project: " + project.getId() );
-
- artifactMap.remove( excludedKey );
- }
- }
- }
-
- verbose( "Processing dependencies for project: " + project.getId() );
-
- List<Artifact> missingArtifacts = new ArrayList<Artifact>();
- for ( Map.Entry<String, Artifact> entry : artifactMap.entrySet() )
+ for ( Artifact artifact : artifacts )
{
- Artifact artifact = entry.getValue();
-
- verbose( "Processing artifact: " + artifact.getId() );
+ verbose( "Purging artifact: " + artifact.getId() );
File deleteTarget = findDeleteTarget( artifact );
@@ -530,12 +520,50 @@ public class PurgeLocalRepositoryMojo
{
deleteTarget.delete();
}
+ artifact.setResolved( false );
+ }
+ }
+
+ private void reResolveArtifacts( MavenProject project, Set<Artifact> artifacts, ArtifactFilter filter )
+ throws ArtifactResolutionException, ArtifactNotFoundException
+ {
- if ( reResolve )
+ // Always need to re-resolve the poms in case they were purged along with the artifact
+ // Maven 2 will not automatically resolve them when resolving the artifact
+ for ( Artifact artifact : artifacts )
+ {
+ try
+ {
+ Artifact pomArtifact =
+ factory.createArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
+ null, "pom" );
+ resolver.resolveAlways( pomArtifact, project.getRemoteArtifactRepositories(), localRepository );
+ }
+ catch ( ArtifactResolutionException e )
{
- verbose( "Re-resolving." );
+ verbose( e.getMessage() );
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ verbose( e.getMessage() );
+ }
+ }
+
+ // If transitive we can just re-resolve the whole tree
+ if ( actTransitively )
+ {
+ resolver.resolveTransitively( artifacts, project.getArtifact(), project.getManagedVersionMap(),
+ localRepository, remoteRepos, metadataSource, filter,
+ Collections.emptyList() );
+ }
+ // If not doing transitive dependency resolution, then we need to resolve one by one.
+ else
+ {
+ List<Artifact> missingArtifacts = new ArrayList<Artifact>();
- artifact.setResolved( false );
+ for ( Artifact artifact : artifacts )
+ {
+ verbose( "Resolving artifact: " + artifact.getId() );
try
{
@@ -543,30 +571,29 @@ public class PurgeLocalRepositoryMojo
}
catch ( ArtifactResolutionException e )
{
- getLog().debug( e.getMessage() );
+ verbose( e.getMessage() );
missingArtifacts.add( artifact );
}
catch ( ArtifactNotFoundException e )
{
- getLog().debug( e.getMessage() );
+ verbose( e.getMessage() );
missingArtifacts.add( artifact );
}
}
- }
- if ( missingArtifacts.size() > 0 )
- {
- String message = "required artifacts missing:\n";
- for ( Artifact missingArtifact : missingArtifacts )
+ if ( missingArtifacts.size() > 0 )
{
- message += " " + missingArtifact.getId() + "\n";
- }
- message += "\nfor the artifact:";
+ String message = "required artifacts missing:\n";
+ for ( Artifact missingArtifact : missingArtifacts )
+ {
+ message += " " + missingArtifact.getId() + "\n";
+ }
+ message += "\nfor the artifact:";
- throw new ArtifactResolutionException( message, project.getArtifact(),
- project.getRemoteArtifactRepositories() );
+ throw new ArtifactResolutionException( message, project.getArtifact(),
+ project.getRemoteArtifactRepositories() );
+ }
}
-
}
private File findDeleteTarget( Artifact artifact )
@@ -589,8 +616,15 @@ public class PurgeLocalRepositoryMojo
deleteTarget = deleteTarget.getParentFile();
}
// else it's file fuzziness.
-
return deleteTarget;
}
+ private void verbose( String message )
+ {
+ if ( verbose || getLog().isDebugEnabled() )
+ {
+ getLog().info( message );
+ }
+ }
+
}
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar?rev=1400760&view=auto
==============================================================================
Binary file - no diff available.
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar.sha1
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar.sha1?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar.sha1 (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.jar.sha1 Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+fdf56536ea1e83a9a00cc0242322eec577d871c9 purge-local-repository-2-1.0.jar
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom Mon Oct 22 04:10:29 2012
@@ -0,0 +1,39 @@
+<?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>purge-local-repository-2</artifactId>
+ <version>1.0</version>
+
+ <name>Test</name>
+ <description>
+ Test dependency:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom.sha1
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom.sha1?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom.sha1 (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/1.0/purge-local-repository-2-1.0.pom.sha1 Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+bdb3ca7130bda98d453079b414335b7f7146dc99 purge-local-repository-2-1.0.pom
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository-2</artifactId>
+ <versioning>
+ <latest>1.0</latest>
+ <release>1.0</release>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ </versioning>
+</metadata>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml.sha1
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml.sha1?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml.sha1 (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository-2/maven-metadata.xml.sha1 Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+a6bd7b895b322500d530480c78c0793c0a59c027
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar?rev=1400760&view=auto
==============================================================================
Binary file - no diff available.
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar.sha1
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar.sha1?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar.sha1 (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.jar.sha1 Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+fdf56536ea1e83a9a00cc0242322eec577d871c9 purge-local-repository-1.0.jar
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom Mon Oct 22 04:10:29 2012
@@ -0,0 +1,47 @@
+<?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>purge-local-repository</artifactId>
+ <version>1.0</version>
+
+ <name>Test</name>
+ <description>
+ Test dependency:purge-local-repository
+ </description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository-2</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+
+</project>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom.sha1
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom.sha1?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom.sha1 (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/1.0/purge-local-repository-1.0.pom.sha1 Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+00f2e3a3760cc828900e0e7587cf8079671a1646 purge-local-repository-1.0.pom
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml Mon Oct 22 04:10:29 2012
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata>
+ <groupId>org.apache.maven.its.dependency</groupId>
+ <artifactId>purge-local-repository</artifactId>
+ <versioning>
+ <latest>1.0</latest>
+ <release>1.0</release>
+ <versions>
+ <version>1.0</version>
+ </versions>
+ </versioning>
+</metadata>
Added: maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml.sha1
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml.sha1?rev=1400760&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml.sha1 (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/test/resources/m2repo/org/apache/maven/its/dependency/purge-local-repository/maven-metadata.xml.sha1 Mon Oct 22 04:10:29 2012
@@ -0,0 +1 @@
+37426f8712b7fb97b6f6fa55e363dabc6f81ccef