10

After a mvn deploy (to a local Nexus) on a project with more than 50 modules I realized that the deployed artifacts had all wrong file names (suffix zip instead of war etc).

Is there something like mvn undeploy to remove these from Nexus again?

2
  • 2
    I think you can only do this through the Nexus admin counsel. You can't do it with maven.
    – Essex Boy
    Commented Oct 21, 2016 at 10:11
  • There is no chance to delete something from nexus without logging in as nexus administrator. You can't do it through Maven. Commented Oct 21, 2016 at 14:28

1 Answer 1

11

You can delete it by using Curl command :

http://host:port/nexus/service/local/repositories/repo-id/content/group-id/artifact-id/version

The delete request can be sent with these parameters, I like to suppress the output except HTTP status code, so that it’s easier to check the result of a series of such commands run from shell script.

curl –request DELETE –write “%{http_code} %{url_effective}\\n” –user admin:admin123 –output /dev/null –silent url

For example you can execute this script from a Freestyle jenkins job.

1
  • 2
    In its simplest form: curl -X DELETE -u admin:admin123 "http://somedomain/nexus/content/repositories/myrepo/com/test/test-artifact/1.0.0/"
    – Marinos An
    Commented Nov 12, 2018 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.