Search code examples
mavencurlnexusartifactorysonatype

Artifactory or Nexus deploy Jar and Pom


I've got a compiled Jar file and a Pom file. Now I want to deploy both of these to Artifactory or Nexus (I've got both).

I want to do it with either mvn:deploy or curl (REST API)

could someone tell me how I do this?


Solution

  • My answers are about Artifactory, of course.

    For using mvn deploy you need to configure your pom file to include distributionManagement tag. You can copy-paste the whole tag from Artifactory UI (click on the repository you want to deploy to, on the right side you'll see the distributionMnagement tag for copying).

    With REST API you can just issue two PUT requests (one for pom, other for jar). Start with the pom.