how to upload JAR to Nexus OSS 3?

后端 未结 3 398
梦如初夏
梦如初夏 2021-01-02 10:07

How to perform an upload of a jar via curl the Nexus 3? I tried using the link tips but without success.

Here are my attempts:

curl -v -         


        
3条回答
  •  庸人自扰
    2021-01-02 10:33

    Contents of directory

    cert_for_nexus.pem

    curl.exe

    pom.xml

    utils-1.0.jar

    Nexus v3 is configured for http

    curl -v -u admin:admin123 --upload-file pom.xml http://localhost:8081/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.pom

    curl -v -u admin:admin123 --upload-file utils-1.0.jar http://localhost:8081/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.jar

    Nexus v3 is configured for https

    • prerequisite: must have curl with SSL enabled (link - left menu)

    curl -v --cacert cert_for_nexus.pem -u admin:admin123 --upload-file pom.xml https://localhost:8443/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.pom

    curl -v --cacert cert_for_nexus.pem -u admin:admin123 --upload-file utils-1.0.jar https://localhost:8443/nexus/repository/maven-releases/org/foo/utils/1.0/utils-1.0.jar

    Contents of pom.xml

    
      4.0.0
      org.foo
      utils
      1
    
    

    EDIT: fixed -u order for both https examples

提交回复
热议问题