ram chander
ram chander

Reputation: 131

Nexus artifact delete command

I have uploaded the artifact to Sonatype Nexus from command line by using MAVEN/maven/bin/mvn -X -e deploy:deploy-file -Durl=http://maven-nexus.com/nexus/content/repositories/xyz -DrepositoryId=xyz -DgroupId=com.kumar -DartifactId=peshu -Dversion=1.0.12 -Dpackaging=war -Dfile=RIGHT.war

Now I would like to delete this version (1.0.12) from command line so that I can automate this process, what is the command I can use instead of Curl.

Upvotes: 8

Views: 14510

Answers (1)

Tony Chemit
Tony Chemit

Reputation: 1205

Short anwser:

curl --request DELETE --write "%{http_code} %{url_effective}\\n" --user login:password --output /dev/null --silent http://maven-nexus.com/nexus/content/repositories/xyz/com.kumar/peshu/1.0.12

This will delete the hole GAV from your nexus.

Note:

  • The --write "%{http_code} %{url_effective}\\n option will return you the http code and the effective url used; idem the --output /dev/null --silent hide some verbose informations on the output,...
  • I am not quite sure, but I think you need a user login with admin rights on the Nexus.

Upvotes: 10

Related Questions