You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Laird Nelson <lj...@gmail.com> on 2010/03/05 23:04:57 UTC

If mirror fails, fall back to original?

Hello; could someone tell me if there's a way to make it so that if a
configured <mirror> isn't working for some reason--or isn't accessible--that
the repository it mirrors should be used directly instead?

I am wide open to various recipes to accomplish the same result.

The setup: I have a Nexus repository manager installed at work.  Sometimes
I'm on the VPN, sometimes I'm not.  I'd like it so that if I'm off the VPN
and therefore Nexus isn't available to proxy all the repositories from any
given POM, that the repositories so proxied should be used directly instead.

The closest I've been able to come is to set up a profile that tests for the
existence of a file that is only accessible when the VPN is up.  If that
profile activates, then it adds the Nexus repository as its only
repository.  But as far as I can tell this profile's list of repositories
doesn't *replace* the POM's list of repositories--it augments it.  So my
Nexus repository is indeed conditionally in the mix, which is nice, but it's
not the ONLY thing in the mix.

In general, it seems like it might be nice to be able to define or take
different behavior if a mirror is not reachable.  Other thoughts?

Best,
Laird

Re: If mirror fails, fall back to original?

Posted by Laird Nelson <lj...@gmail.com>.
On Fri, Mar 5, 2010 at 5:25 PM, Brian Fox <br...@infinity.nu> wrote:

> Further, you can configure Nexus to do the automatic fallback:
>
> http://www.sonatype.com/books/nexus-book/reference/config-sect-manage-repo.html#sect-config-selecting-mirrors-proxy
>

Ah, I think--not sure yet, coffee is still brewing--that this is exactly
what I'm looking for.  My apologies for passing this by on my last read of
the Nexus book.  Thanks!

Best,
Laird

Re: If mirror fails, fall back to original?

Posted by Brian Fox <br...@infinity.nu>.
Further, you can configure Nexus to do the automatic fallback:
http://www.sonatype.com/books/nexus-book/reference/config-sect-manage-repo.html#sect-config-selecting-mirrors-proxy

On Fri, Mar 5, 2010 at 5:15 PM, Jesse Farinacci <ji...@gmail.com> wrote:
> Hi Laird,
>
> On Fri, Mar 5, 2010 at 5:04 PM, Laird Nelson <lj...@gmail.com> wrote:
>>
>> The setup: I have a Nexus repository manager installed at work.  Sometimes
>> I'm on the VPN, sometimes I'm not.  I'd like it so that if I'm off the VPN
>> and therefore Nexus isn't available to proxy all the repositories from any
>> given POM, that the repositories so proxied should be used directly instead.
>>
>
> Why don't you set up a local MRM (e.g. Nexus) on your work station and
> mirrorOf * to it. You could then customize your local MRM to
> proxy-host from your official corporate MRM. You probably also want to
> create rules on your local MRM to never try and fetch your internal
> corporate artifacts from anywhere other than the official corporate
> MRM.
>
> This setup works pretty great, I've been using it for quite a while.
>
> Good luck!
> -Jesse
>
> --
> There are 10 types of people in this world, those
> that can read binary and those that can not.
>
> ---------------------------------------------------------------------
> 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: If mirror fails, fall back to original?

Posted by Jesse Farinacci <ji...@gmail.com>.
Hi Laird,

On Fri, Mar 5, 2010 at 5:04 PM, Laird Nelson <lj...@gmail.com> wrote:
>
> The setup: I have a Nexus repository manager installed at work.  Sometimes
> I'm on the VPN, sometimes I'm not.  I'd like it so that if I'm off the VPN
> and therefore Nexus isn't available to proxy all the repositories from any
> given POM, that the repositories so proxied should be used directly instead.
>

Why don't you set up a local MRM (e.g. Nexus) on your work station and
mirrorOf * to it. You could then customize your local MRM to
proxy-host from your official corporate MRM. You probably also want to
create rules on your local MRM to never try and fetch your internal
corporate artifacts from anywhere other than the official corporate
MRM.

This setup works pretty great, I've been using it for quite a while.

Good luck!
-Jesse

-- 
There are 10 types of people in this world, those
that can read binary and those that can not.

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


Re: If mirror fails, fall back to original?

Posted by Ron Wheeler <rw...@artifact-software.com>.
Laird Nelson wrote:
> Hello; could someone tell me if there's a way to make it so that if a
> configured <mirror> isn't working for some reason--or isn't accessible--that
> the repository it mirrors should be used directly instead?
>
> I am wide open to various recipes to accomplish the same result.
>
> The setup: I have a Nexus repository manager installed at work.  Sometimes
> I'm on the VPN, sometimes I'm not.  I'd like it so that if I'm off the VPN
> and therefore Nexus isn't available to proxy all the repositories from any
> given POM, that the repositories so proxied should be used directly instead.
>
> The closest I've been able to come is to set up a profile that tests for the
> existence of a file that is only accessible when the VPN is up.  If that
> profile activates, then it adds the Nexus repository as its only
> repository.  But as far as I can tell this profile's list of repositories
> doesn't *replace* the POM's list of repositories--it augments it.  So my
> Nexus repository is indeed conditionally in the mix, which is nice, but it's
> not the ONLY thing in the mix.
>
> In general, it seems like it might be nice to be able to define or take
> different behavior if a mirror is not reachable.  Other thoughts?
>
> Best,
> Laird
>   

Why not simply make your Nexus available on the Internet and password 
protect the access.
I can reach mine from anywhere in the world as long as I am on the net.

Ron


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