How to manually deploy artifacts in Nexus Repository Manager OSS 3

123,887

Solution 1

This is implemented in Nexus since Version 3.9.0.

  • Login
  • Select Upload

enter image description here

  • Fill out form and upload Artifact

enter image description here

Solution 2

I'm using maven deploy file.

mvn deploy:deploy-file -DgroupId=my.group.id \
    -DartifactId=my-artifact-id \
    -Dversion=1.0.0.1 \
    -Dpackaging=jar \
    -Dfile=foo.jar \
    -DgeneratePom=true \
    -DrepositoryId=my-repo \
    -Durl=http://my-nexus-server.com:8081/repository/maven-releases/

UPDATE: As stated in comments using quotes in url cause NoSuchElementException

But I have add server config in my maven (~/.m2/settings.xml).

<servers>
  <server>
    <id>my-repo</id>
    <username>admin</username>
    <password>admin123</password>
  </server>
</servers>

References:

Maven Apache - Guide 3rd party jars

Solution 3

This isn't currently implemented in the UI in Nexus 3 (see https://issues.sonatype.org/browse/NEXUS-10121). You'll need to use curl or mvn deploy or some other option.

Solution 4

You can upload artifacts via their native publishing capabilities (e.g. maven deploy, npm publish).

You can also upload artifacts to "raw" repositories via a simple curl request, e.g.

curl --fail -u admin:admin123 --upload-file foo.jar 'http://my-nexus-server.com:8081/repository/my-raw-repo/'

Solution 5

My Team built a command line tool for uploading artifacts to nexus 3.x repository, Maybe it's will be helpful for you - Maven Artifacts Uploader

Share:
123,887

Related videos on Youtube

Paweł Głowacz
Author by

Paweł Głowacz

The best programmf**ker in this lost world... Time to eradicate some code or libs. A good plan violently executed now is better than a perfect plan executed next week.

Updated on June 19, 2021

Comments

  • Paweł Głowacz
    Paweł Głowacz about 3 years

    After installing Nexus Repository Manager OSS 3 I do not see option Artifact Upload to upload artifacts through web page.

    In Nexus Repository Manager OSS 2.13 there is option to do that operation.

    Anyone can show me the way how to upload artifacts to hosted repository in Nexus 3?

    EDIT: From 3.9.0 version, this functionality is implemented.

    • grajsek
      grajsek over 7 years
      In my answer here I explained both approaches - for http and https.
    • user2649601
      user2649601 over 7 years
      why on earth would they leave out this essential piece of functionality?
    • István Rábel
      István Rábel about 7 years
      Since the upload GUI still not part of Nexus 3, we have created a lightweight solution to provide the missing interface. You can host a html page in a raw repository of your Nexus3 instance, and when you access that page from the browser, it will provide an upload GUI similar to the one in Nexus2. The project can be found on GitHub with detailed documentation. The released version at the time of this answer supports GAV style and raw uploads as well.
  • demaniak
    demaniak about 7 years
    As time goes by this is turning out to be a MASSIVE PITA.
  • TOUDIdel
    TOUDIdel over 6 years
    But only for Windows users?
  • Ron Badur
    Ron Badur over 6 years
    At this moment, yes
  • John Glassman
    John Glassman about 6 years
    We had 3.7 installed and the feature matrix was saying this should exist (3.10 is now current). I was going mad trying to figure out how it was implemented. This answer was very helpful. I'd up vote you 10 times if I could.
  • Arkadi
    Arkadi about 6 years
    Bower (hosted) repositories don't have upload feature :/
  • Varun Verma
    Varun Verma almost 4 years
    @tobias what's the typical value for extension?
  • 17hao
    17hao over 3 years
    @Varun Verma filename extension e.g. jar

Related