问题
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 ?
回答1:
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
来源:https://stackoverflow.com/questions/34115434/how-to-delete-artifacts-with-classifier-from-nexus-using-rest-api