Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aether-users] Remove/Delete artifact from repository

Hi Mike,

> I use RepositorySystem.deploy(repositorySystemSession, deployRequest) to
> deploy artifacts to local repositories. I however also need the opposite
> function; something to delete an artifact from a local repository or
> repositories.
> 
> I looked at Artifact.getFile() with a view to deleting the file (and
> probably other related parent/peer files) however presumably that only
> retrieve a single File for a single local repository.
> 
> Is it possible to delete artifacts from local repositories using Aether?

AFAIK, Aether (deliberately?) doesn't offer this functionality.

That being said, when I come across tasks like this, I often search for
a Maven plugin that needs to do something similar. In this case,
build-helper:remove-project-artifact [1] and
dependency:purge-local-repository [2] come to mind. Their use of Aether
or its predecessor has probably seen more real-world testing than your
code will anytime soon, so chances are that they don't delete an
artifact only half-way, making a mess of the repository's metadata.

Hope this helps.

Andreas

[1]
<http://mojo.codehaus.org/build-helper-maven-plugin/remove-project-artifact-mojo.html>
[2]
<http://maven.apache.org/plugins/maven-dependency-plugin/purge-local-repository-mojo.html>

-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top