Search code examples
linuxapicurlnexussonatype

Sonatype OSS 3.28.1-01: Can't Delete specific directory having jar files using cURL


I am using the following cURL command to delete one directory from a repository:

curl --request DELETE --user "login:password" http://myNexus/service/local/repositories/myRepository/content/myGroupId/myArtifactId/myVersion/myArtifactId-myVersion.jar

But in my Linux CLI, no output is coming, even no error, and also the jar is not deleting.

Also can't delete the maven version build from the repo. The component I want to delete


Solution

  • I have achieved the same by using the below cURL

    curl -X DELETE -u <Username>:<Password> http://<Nexus Host IP Address>:8081/repository/<repository>/com/dir1/dir2/<build name>/<build_version>/<Build Name>.jar
    

    Moreover we need to remove any other residues like jar.md5 , jar.sha1 ,pom , pom.md5 , pom.sha1

    When all the files under the build directory gets cleared off , the directory also gets deleted from nexus.