Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

maven

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?

like image 975
Marcus Avatar asked Oct 21 '16 10:10

Marcus


People also ask

Why deploy artifacts in Nexus for deployment?

Nexus is a repository manager that stores “artifacts”, which allows you to proxy collect and manage your dependencies, making it easy to distribute your software.

What is Maven deploy?

The deploy plugin is primarily used during the deploy phase, to add your artifact(s) to a remote repository for sharing with other developers and projects. This is usually done in an integration or release environment.


1 Answers

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.

like image 105
Inforedaster Avatar answered Oct 05 '22 08:10

Inforedaster