Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete artifacts with classifier from Nexus using REST API?

I know how to delete a whole GAV using this command :

curl --request DELETE --user "login:password" http://myNexus/service/local/repositories/myRepository/content/myGroupId/myArtifactId/myVersion

It works like a charm.

Now I need to just delete an artifact with a classifier, I could not find or read a solution for this.

I wonder if there is a way to delete an artifact with a classifier using the Nexus REST API ?

like image 220
Tony Chemit Avatar asked Dec 06 '15 08:12

Tony Chemit


1 Answers

To delete an specific artifact, use this command:

curl --request DELETE --user "login:password" http://myNexus/service/local/repositories/myRepository/content/myGroupId/myArtifactId/myVersion/myArtifactId-myVersion.jar

You need then to ask nexus to rebuild metadata for the gav (otherwise the *.md5 and *.sha1 files will stay on you repository)

curl -v --request DELETE  --user "login:password"  --silent http://nexusHost/service/local/metadata/repositories/myRepository/content
like image 55
Arktan Avatar answered Oct 07 '22 22:10

Arktan