You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2010/05/15 22:29:45 UTC
svn commit: r944714 -
/maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
Author: bentmann
Date: Sat May 15 20:29:45 2010
New Revision: 944714
URL: http://svn.apache.org/viewvc?rev=944714&view=rev
Log:
o Added method to purge specific g:a:v from local repo
Modified:
maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
Modified: maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java?rev=944714&r1=944713&r2=944714&view=diff
==============================================================================
--- maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java (original)
+++ maven/shared/trunk/maven-verifier/src/main/java/org/apache/maven/it/Verifier.java Sat May 15 20:29:45 2010
@@ -850,6 +850,31 @@ public class Verifier
}
/**
+ * Deletes all artifacts in the specified g:a:v from the local repository.
+ *
+ * @param gid The group id whose artifacts should be deleted, must not be <code>null</code>.
+ * @param aid The artifact id whose artifacts should be deleted, must not be <code>null</code>.
+ * @param version The (base) version whose artifacts should be deleted, must not be <code>null</code>.
+ * @throws IOException If the artifacts could not be deleted.
+ * @since 1.3
+ */
+ public void deleteArtifacts( String gid, String aid, String version )
+ throws IOException
+ {
+ String path;
+ if ( "default".equals( localRepoLayout ) )
+ {
+ path = gid.replace( '.', '/' ) + '/' + aid + '/' + version;
+ }
+ else
+ {
+ throw new IllegalStateException( "Unsupported repository layout: " + localRepoLayout );
+ }
+
+ FileUtils.deleteDirectory( new File( localRepo, path ) );
+ }
+
+ /**
* Deletes the specified directory.
*
* @param path The path to the directory to delete, relative to the base directory, must not be <code>null</code>.