Discussion:
obtain latest snapshot with single http call?
Beat Strasser
2009-12-07 19:13:47 UTC
Permalink
Hello
Can I just do a 'wget' against nexus to grab the latest snapshot
and copy this to webserver? Is there a special "latest snapshot"
link available in nexus or must I download the process the metadata
to determine the latest one?
I had the same problem with getting the latest snapshot version (since
Maven 3 doesn't support non unique versions anymore).
http://<host>:<port>/nexus/service/local/artifact/maven/redirect?r=<repository>&g=<groupId>&a=<artifactId>&v=<version>&p=<type>
Nexus will handle the SNAPSHOT conversion to latest so you don't need
to read the metadata or anything like that.
However, how do you handle authentication? For the above url to work,
you need a valid session cookie. I'd would be ideal to have a single
http call (using wget for example) with HTTP Basic Authentication (with
SSL). Is there already a solution available for this?

Thx for any hint,
--
Beat Strasser
Beat Strasser
2009-12-07 19:26:26 UTC
Permalink
Post by Beat Strasser
However, how do you handle authentication? For the above url to work,
you need a valid session cookie. I'd would be ideal to have a single
http call (using wget for example) with HTTP Basic Authentication (with
SSL). Is there already a solution available for this?
I just use basic auth and seems to work fine. Have you tried it?
Yes. It only works in my browser when I first do a regular nexus web
site login. And I get a 401 if I try it with wget:

wget "https://host/service/local/..." --user asdf --password asdf

I'm using Nexus OSS 1.4.0.
--
Beat Strasser
Brian Fox
2009-12-07 20:15:37 UTC
Permalink
Use curl. There's a fix in 1.4.1 to make the auth work better with
wget but curl should work fine.

--Brian (mobile)


On Dec 7, 2009, at 1:26 PM, Beat Strasser
Post by Beat Strasser
Post by Beat Strasser
However, how do you handle authentication? For the above url to work,
you need a valid session cookie. I'd would be ideal to have a single
http call (using wget for example) with HTTP Basic Authentication (with
SSL). Is there already a solution available for this?
I just use basic auth and seems to work fine. Have you tried it?
Yes. It only works in my browser when I first do a regular nexus web
wget "https://host/service/local/..." --user asdf --password asdf
I'm using Nexus OSS 1.4.0.
--
Beat Strasser
---------------------------------------------------------------------
Beat Strasser
2009-12-07 21:09:14 UTC
Permalink
Hi Brian
Use curl. There's a fix in 1.4.1 to make the auth work better with wget
but curl should work fine.
Thanks, curl works perfectly. And under certain circumstances, wget
seems to work also.
--
Beat Strasser
Loading...