You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gilles Scokart <gs...@gmail.com> on 2013/02/27 09:00:48 UTC

How to play with 2 repositories ?

I have a repository at work that is only accessible from our intranet.  This
repository is configured in my personal setting as a repository (for some
company artefact) and as a mirror for all other repository.

When I'm home, I use an other settings file without this repository and the
mirror config.  But when I launch a build, it seems that he need to
redownload all plugin and dependencies.
I also have difficulties to launch build with option -o because some plugin
are not found in my local repository altought they are there (but maybe
donwloaded from the miror).

How can I configure my settings files so that when I switch the config I
keep my entire local repository useable, independantly of the place from
where I downloaded it.

-----
Gilles Scokart  



--
View this message in context: http://maven.40175.n5.nabble.com/How-to-play-with-2-repositories-tp5748541.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: How to play with 2 repositories ?

Posted by Anders Hammar <an...@hammar.net>.
With Maven 3 you currently can't. The rational is that Maven tries to
ensure that you're using the right artifact. So if the cached artifact is
from a different repo than the one you're using now, it will re-download it.

/Anders


On Wed, Feb 27, 2013 at 9:00 AM, Gilles Scokart <gs...@gmail.com> wrote:

> I have a repository at work that is only accessible from our intranet.
>  This
> repository is configured in my personal setting as a repository (for some
> company artefact) and as a mirror for all other repository.
>
> When I'm home, I use an other settings file without this repository and the
> mirror config.  But when I launch a build, it seems that he need to
> redownload all plugin and dependencies.
> I also have difficulties to launch build with option -o because some plugin
> are not found in my local repository altought they are there (but maybe
> donwloaded from the miror).
>
> How can I configure my settings files so that when I switch the config I
> keep my entire local repository useable, independantly of the place from
> where I downloaded it.
>
> -----
> Gilles Scokart
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/How-to-play-with-2-repositories-tp5748541.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to play with 2 repositories ?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Gillen,

> How can I configure my settings files so that when I switch the config
> I keep my entire local repository useable, independantly of the place
> from where I downloaded it.

As a workaround, could you copy your work settings.xml to your home
machine, and have a quick "go offline" script that swaps it in or out? The
settings would then only be used to make Maven happy; you would hopefully
never actually need to ping your work servers.

On a related note: I heartily recommend the "mvn dependency:go-offline"
goal, in case you were not already using it, which tries to download
everything you might possibly need for the given project while offline.
Using it will better ensure that "mvn -o" works as desired (though not all
plugins respect "-o" so still not a total guarantee).

Regards,
Curtis


On Wed, Feb 27, 2013 at 2:00 AM, Gilles Scokart <gs...@gmail.com> wrote:

> I have a repository at work that is only accessible from our intranet.
>  This
> repository is configured in my personal setting as a repository (for some
> company artefact) and as a mirror for all other repository.
>
> When I'm home, I use an other settings file without this repository and the
> mirror config.  But when I launch a build, it seems that he need to
> redownload all plugin and dependencies.
> I also have difficulties to launch build with option -o because some plugin
> are not found in my local repository altought they are there (but maybe
> donwloaded from the miror).
>
> How can I configure my settings files so that when I switch the config I
> keep my entire local repository useable, independantly of the place from
> where I downloaded it.
>
> -----
> Gilles Scokart
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/How-to-play-with-2-repositories-tp5748541.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to play with 2 repositories ?

Posted by Wayne Fay <wa...@gmail.com>.
> How can I configure my settings files so that when I switch the config I
> keep my entire local repository useable, independantly of the place from
> where I downloaded it.

Another common solution to this problem is to simply run your own
local MRM on the laptop that goes from work to home and back.

Wayne

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


Re: How to play with 2 repositories ?

Posted by Olivier Lamy <ol...@apache.org>.
Read http://jira.codehaus.org/browse/MNG-5185 .
So you will have a workaround with 3.1.0 .

2013/2/27 Gilles Scokart <gs...@gmail.com>:
> I have a repository at work that is only accessible from our intranet.  This
> repository is configured in my personal setting as a repository (for some
> company artefact) and as a mirror for all other repository.
>
> When I'm home, I use an other settings file without this repository and the
> mirror config.  But when I launch a build, it seems that he need to
> redownload all plugin and dependencies.
> I also have difficulties to launch build with option -o because some plugin
> are not found in my local repository altought they are there (but maybe
> donwloaded from the miror).
>
> How can I configure my settings files so that when I switch the config I
> keep my entire local repository useable, independantly of the place from
> where I downloaded it.
>
> -----
> Gilles Scokart
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/How-to-play-with-2-repositories-tp5748541.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>



--
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy

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