Marcus
Marcus

Reputation: 2121

Something like “mvn undeploy” to remove artifacts from Nexus?

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?

Upvotes: 11

Views: 11894

Answers (1)

Inforedaster
Inforedaster

Reputation: 1330

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.

Upvotes: 11

Related Questions