You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by James Russo <jr...@halo3.net> on 2009/11/13 14:43:48 UTC

obtain latest snapshot to put on website for auto-update?

Hello,

	I have some auto-update functionality built into an application, but  
I am looking to integrate it a bit with maven. I'd like to be able to  
export the latest snapshot to a location on our website where the  
updater can download it. I use nexus as my repo manager, but I have  
that locked down to require a login and I don't want to open this up.  
I want a simple public download URL.

Any suggestions on how I accomplish this? 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?

Perhaps I should just setup a simple no artifacts pom file which lists  
the artifact as a dependency and let that maven grab it for me?

Thanks!

-jr


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: obtain latest snapshot to put on website for auto-update?

Posted by James Russo <jr...@halo3.net>.
Peter,

	exactly what I was looking for. Thanks!

-jr

On Nov 13, 2009, at 1:32 PM, Hayes, Peter wrote:

> You can use this url:
>
> 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.
>
> Peter
>
> -----Original Message-----
> From: James Russo [mailto:jr@halo3.net]
> Sent: Friday, November 13, 2009 1:29 PM
> To: Maven Users List
> Subject: Re: obtain latest snapshot to put on website for auto-update?
>
> Wayne,
> 	
> 	Thanks for your reply. I had thought the repo spec was fairly
> standardized by maven, so regardless of repo manager I might be able
> to accomplish this.  I will post it on the nexus user list though for
> more input.
> 
> I think maybe the simplest solution would be to write a script to
> authenticate against nexus (the HTTP based repo really), fetch the
> maven-metadata.xml file which appears to have info on the latest
> snapshot for a specific artifact and fetch it from there.
>
> -jr
>
>
> On Nov 13, 2009, at 11:12 AM, Wayne Fay wrote:
>
>>> 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
>>
>> You do know about the Nexus User list, right? As a percentage of
>> users, maybe 15% of the Maven Users know anything about Nexus, vs
>> ~100% of those on Nexus Users list.
>>
>>> Perhaps I should just setup a simple no artifacts pom file which
>>> lists the
>>> artifact as a dependency and let that maven grab it for me?
>>
>> Sounds like a reasonable solution. Otherwise this sounds like a good
>> feature request for Nexus.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: obtain latest snapshot with single http call?

Posted by James Russo <jr...@halo3.net>.
I use this call

wget --http-user=XXX --http-password=XXX http://XXXX/service/local/artifact/maven/redirect?r=snapshots&g=com.uappoint&a=MODULE-A&v=3.0.1-SNAPSHOT&p=exe"

but I am not running 4.0 yet. --http-user and --user should be equiv according to man page. 

I connect, get a 301 and then get 200 OK an download the artifact. 

-jr


On Dec 7, 2009, at 2:26 PM, Beat Strasser wrote:

>> On Dec 7, 2009, at 2:13 PM, Beat Strasser wrote:
>>> 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [nexus-user] Re: obtain latest snapshot with single http call?

Posted by Beat Strasser <be...@inventage.com>.
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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: obtain latest snapshot with single http call?

Posted by Beat Strasser <be...@inventage.com>.
> On Dec 7, 2009, at 2:13 PM, Beat Strasser wrote:
>> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: obtain latest snapshot with single http call?

Posted by James Russo <jr...@halo3.net>.

On Dec 7, 2009, at 2:13 PM, Beat Strasser wrote:
> 
> 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?

-jr

Re: obtain latest snapshot with single http call?

Posted by Beat Strasser <be...@inventage.com>.
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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: obtain latest snapshot to put on website for auto-update?

Posted by "Hayes, Peter" <Pe...@fmr.com>.
You can use this url:

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.

Peter

-----Original Message-----
From: James Russo [mailto:jr@halo3.net] 
Sent: Friday, November 13, 2009 1:29 PM
To: Maven Users List
Subject: Re: obtain latest snapshot to put on website for auto-update?

Wayne,
	
	Thanks for your reply. I had thought the repo spec was fairly  
standardized by maven, so regardless of repo manager I might be able  
to accomplish this.  I will post it on the nexus user list though for  
more input.

I think maybe the simplest solution would be to write a script to  
authenticate against nexus (the HTTP based repo really), fetch the  
maven-metadata.xml file which appears to have info on the latest  
snapshot for a specific artifact and fetch it from there.

-jr


On Nov 13, 2009, at 11:12 AM, Wayne Fay wrote:

>> 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
>
> You do know about the Nexus User list, right? As a percentage of
> users, maybe 15% of the Maven Users know anything about Nexus, vs
> ~100% of those on Nexus Users list.
>
>> Perhaps I should just setup a simple no artifacts pom file which  
>> lists the
>> artifact as a dependency and let that maven grab it for me?
>
> Sounds like a reasonable solution. Otherwise this sounds like a good
> feature request for Nexus.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: obtain latest snapshot to put on website for auto-update?

Posted by James Russo <jr...@halo3.net>.
Wayne,
	
	Thanks for your reply. I had thought the repo spec was fairly  
standardized by maven, so regardless of repo manager I might be able  
to accomplish this.  I will post it on the nexus user list though for  
more input.

I think maybe the simplest solution would be to write a script to  
authenticate against nexus (the HTTP based repo really), fetch the  
maven-metadata.xml file which appears to have info on the latest  
snapshot for a specific artifact and fetch it from there.

-jr


On Nov 13, 2009, at 11:12 AM, Wayne Fay wrote:

>> 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
>
> You do know about the Nexus User list, right? As a percentage of
> users, maybe 15% of the Maven Users know anything about Nexus, vs
> ~100% of those on Nexus Users list.
>
>> Perhaps I should just setup a simple no artifacts pom file which  
>> lists the
>> artifact as a dependency and let that maven grab it for me?
>
> Sounds like a reasonable solution. Otherwise this sounds like a good
> feature request for Nexus.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: obtain latest snapshot to put on website for auto-update?

Posted by Wayne Fay <wa...@gmail.com>.
> 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

You do know about the Nexus User list, right? As a percentage of
users, maybe 15% of the Maven Users know anything about Nexus, vs
~100% of those on Nexus Users list.

> Perhaps I should just setup a simple no artifacts pom file which lists the
> artifact as a dependency and let that maven grab it for me?

Sounds like a reasonable solution. Otherwise this sounds like a good
feature request for Nexus.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org