You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Brown, Carlton" <Ca...@compucredit.com> on 2008/02/28 19:49:01 UTC

How to set username/password on a mirror?

How do you configure Maven to supply a username/password to a mirror
that expects it?
 
I've configured Maven to route all its requests through our internal
Archiva proxy by setting the proxy as mirrorOf * as is usually done:
       <mirror>
             <id>ourcorp-internal</id>
 
<url>http://repo.ourcorp.com/archiva/repository/m2-central-cached/</url>
             <mirrorOf>*</mirrorOf>
       </mirror>
 
The problem is, Archiva is returning 401 access denied.*   I get a
username/password prompt when I plug this URL into a browser, so I guess
Archiva expects Maven to pass these credentials, but where am I supposed
to declare them in the Maven config?   I searched the settings docs, but
they have nothing to say about this situation (at least the docs I
found).
 
Advice or alternate workaround config appreciated, thanks in advance... 
 
* You might ask, how can I be so certain it's a 401 error when the Maven
error message shows no details of connection failures?  I used a packet
sniffer.



-----------------------------------------
====================================================
This message contains PRIVILEGED and CONFIDENTIAL
information that is intended only for use by the 
named recipient. If you are not the named recipient,
any disclosure, dissemination, or action based on 
the contents of this message is prohibited. In such
case please notify us and destroy and delete all 
copies of this transmission.  Thank you.
====================================================

Re: How to set username/password on a mirror?

Posted by Wayne Fay <wa...@gmail.com>.
Names and passwords for servers generally go in
settings.xml/servers/server. Give that a try:
http://maven.apache.org/settings.html#Servers

Otherwise, you can try http://user:pass@server:port/path which works
most of the time I've attempted to use it with Java apps.

Wayne

On 2/28/08, Brown, Carlton <Ca...@compucredit.com> wrote:
> How do you configure Maven to supply a username/password to a mirror
> that expects it?
>
> I've configured Maven to route all its requests through our internal
> Archiva proxy by setting the proxy as mirrorOf * as is usually done:
>       <mirror>
>             <id>ourcorp-internal</id>
>
> <url>http://repo.ourcorp.com/archiva/repository/m2-central-cached/</url>
>             <mirrorOf>*</mirrorOf>
>       </mirror>
>
> The problem is, Archiva is returning 401 access denied.*   I get a
> username/password prompt when I plug this URL into a browser, so I guess
> Archiva expects Maven to pass these credentials, but where am I supposed
> to declare them in the Maven config?   I searched the settings docs, but
> they have nothing to say about this situation (at least the docs I
> found).
>
> Advice or alternate workaround config appreciated, thanks in advance...
>
> * You might ask, how can I be so certain it's a 401 error when the Maven
> error message shows no details of connection failures?  I used a packet
> sniffer.
>
>
>
> -----------------------------------------
> ====================================================
> This message contains PRIVILEGED and CONFIDENTIAL
> information that is intended only for use by the
> named recipient. If you are not the named recipient,
> any disclosure, dissemination, or action based on
> the contents of this message is prohibited. In such
> case please notify us and destroy and delete all
> copies of this transmission.  Thank you.
> ====================================================

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