0

I need to download an artifact from nexus repository using command line. The artifact file name is unknowm but the extension name is always *.zip. I am using the curl command with wildcard characters. When I execute the command it says HTTP/1.1 404 Not Found

curl --insecure -O -u username:password -v https://nexus.internal.org.com/content/repositories/snapshots/com/org/artifact/1.4.0/*.zip

> Accept: */*
>
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed
 0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--   0< HTTP/1.1 404 Not Found
< Accept-Ranges: bytes
< Content-Type: text/html
< Date: Wed, 01 Mar 2017 22:28:35 GMT
< Server: Nexus/2.14.2-01
< X-Content-Type-Options: nosniff
< X-Frame-Options: SAMEORIGIN
< transfer-encoding: chunked
< Connection: keep-alive

The file is actually present in the URL location. Is the command I'm running alright?

1

1 Answer 1

1

I found a good way to do this with the instructions from this answer that basically requests the content of an entire prefix, sets some boundaries into the recursion and filters accepted files by a shell-like pattern.

If I am not mistaken, the command to do what you want would be:

wget --recursive --level=1 --no-parent --no-directories \
  --accept '*.zip' \
  --directory-prefix=. \
   https://nexus.internal.org.com/content/repositories/snapshots/com/org/artifact/1.4.0/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.