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

亡梦爱人 提交于 2019-12-18 16:32:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!