How to download artifacts from Nexus 3.14 version by using curl

8,409 views
Skip to first unread message

Vikram Kumar

unread,
Dec 14, 2018, 7:45:05 AM12/14/18
to Nexus Users
hi , How to download artifacts from Nexus 3.14 version by using curl. same command will be using in jenkins pipeline to get the data.

Could anyone help on this ?

thanks ,
Vikram 

mke...@sonatype.com

unread,
Dec 14, 2018, 8:27:05 AM12/14/18
to Nexus Users
Hello.

You can find the necessary information here:


Regards,

Michael.
Message has been deleted
Message has been deleted

Peter Lynch

unread,
Dec 17, 2018, 12:27:58 PM12/17/18
to vikramd...@gmail.com, Nexus Users


On Sat, Dec 15, 2018 at 4:07 AM Vikram Kumar <vikramd...@gmail.com> wrote:
Getting below output:  but artifacts are not download Jenkins work space & showing continuationToken" : null.

May i know why artifacts are not downloaded in jenkins work space.


The command you used returns JSON as expected.

Either send a another request using the downloadUrl value for each asset, or perhaps use the search and download API described here:


 
Command: executed 'sheel command' in Jenkins Freestyle project.


Output :

Started by user unknown or anonymous
Building in workspace /var/lib/jenkins/workspace/down-v1
[down-v1] $ /bin/sh -xe /tmp/jenkins6006270048285653512.sh
+ curl -u admin:admin123 -X GET http://192.168.2.4:8081/service/rest/v1/search/assets
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1431  100  1431    0     0  31620      0 --:--:-- --:--:-- --:--:-- 31800
100  1431  100  1431    0     0  31496      0 --:--:-- --:--:-- --:--:-- 31800
{
  "items" : [ {
    "downloadUrl" : "http://192.168.2.4:8081/repository/training-release/Dashboard/Demo1/1.0/Demo1-1.0.rar",
    "path" : "Dashboard/Demo1/1.0/Demo1-1.0.rar",
    "id" : "dHJhaW5pbmctcmVsZWFzZTpkNDgxMTc1NDFkY2I4OWVjNjEzYjIzOTczMjAxZDdiYQ",
    "repository" : "training-release",
    "format" : "maven2",
    "checksum" : {
      "sha1" : "b7601636cd2a14262058ed347f9016fc0977e32b",
      "md5" : "849f77953d76c7eba319bca8b207575e"
    }
  }, {
    "downloadUrl" : "http://192.168.2.4:8081/repository/training-release/Dashboard/Demo1/1.0/Demo1-1.0.rar.md5",
    "path" : "Dashboard/Demo1/1.0/Demo1-1.0.rar.md5",
    "id" : "dHJhaW5pbmctcmVsZWFzZTowYWI4MGE3NDM5MjFlNDI2NjE5YmVmMmJiZGFhNTkxZA",
    "repository" : "training-release",
    "format" : "maven2",
    "checksum" : {
      "sha1" : "b0ca6f592dd1b9879f757d8a77703f8c6c84f528",
      "md5" : "e6cf41253a805f6da4693045775824be"
    }
  }, {
    "downloadUrl" : "http://192.168.2.4:8081/repository/training-release/Dashboard/Demo1/1.0/Demo1-1.0.rar.sha1",
    "path" : "Dashboard/Demo1/1.0/Demo1-1.0.rar.sha1",
    "id" : "dHJhaW5pbmctcmVsZWFzZToxM2IyOWU0NDlmMGUzYjhkMzk5NjRlZDNlMTEwZTJlMw",
    "repository" : "training-release",
    "format" : "maven2",
    "checksum" : {
      "sha1" : "36f61229b7b1762717e07a450a144f9f45b153ca",
      "md5" : "8ba72aa83eabaa3a3cad219acbb2536a"
    }
  } ],
  "continuationToken" : null
}Finished: SUCCESS

--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/a5b85d15-61d6-4344-8973-be16d2501245%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.
Reply all
Reply to author
Forward
0 new messages