Skip to content

Commit

Permalink
o Added method to purge specific g:a:v from local repo
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/maven/shared/trunk@944714 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bentmann committed May 15, 2010
1 parent c17cdc4 commit 7ae1c06
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions maven-verifier/src/main/java/org/apache/maven/it/Verifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,31 @@ else if ( "legacy".equals( localRepoLayout ) )
FileUtils.deleteDirectory( new File( localRepo, path ) );
}

/**
* 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.
*
Expand Down

0 comments on commit 7ae1c06

Please sign in to comment.