Maven keeps track of the source of the artifacts that it downloads.

When you swap out your settings.xml, then the source changes from your
corporate proxy to maven central.

Thus Maven expects that the artifacts in the cache may no longer even exist
or may be different.

Maven therefore tries to re-download at least the checksums and potentially
the artifacts themselves.

The legacy-local-repository switch disables the origin checking, similarly
by putting a proxy between you and the actual source of the artifacts you
convince Maven that everything is coming from where it got them last time,
so it will remain happy trusting the artifacts are from the source it knows.


On 24 September 2013 14:01, Jamie Archibald <jam...@gmail.com> wrote:

> Ah ok makes sense. While this would work, it still doesn't explain why
> maven is trying to redownload an artifact that is already in my local repo.
> I'm reading the maven definitive guide and it hasnt explained much about
> how  maven resolves dependencies on the wire. However haven't reached the
> nexus repo chapter yet. Also the definitive guide is maven 2 while I'm
> using 3 so I'm sure there is a lot missing.
>
> Ill try it out and see what happens.
>
> Thanks!
>
>
>
> On Tuesday, September 24, 2013, Ron Wheeler wrote:
>
> > I think that he was suggesting that you install it as a proxy so that it
> > would not contain any actual artifacts.
> > In the office, it would proxy your real Nexus and when you are off-line
> it
> > would act as local repo that would not actually resolve anything but
> would
> > keep your settings.xml happy. It would point to your office Nexus which
> > would be available at the office and off-line at home.
> >
> > I think that this is what was being proposed and would not break the
> > "Maven way".
> >
> > You would still do your deploys to the corporate nexus.
> > Your builds would all be portable since they have no idea about how your
> > settings.xml has added another proxy layer.
> >
> > Does this help a bit?
> >
> > Ron
> >
> >
> > On 24/09/2013 8:19 AM, Jamie Archibald wrote:
> >
> >> That seems like overkill. The whole point to a local maven repository is
> >> to
> >> provide caching so you don't have to continually redownload load
> >> artifacts.
> >> Also, installing a nexus repo on my machine seems counterproductive from
> >> "the maven way" which includes portable builds.
> >>
> >> Unless I'm completely wrong?
> >>
> >> Jamie
> >>
> >>
> >>
> >> On Tuesday, September 24, 2013, Markku Saarela wrote:
> >>
> >>  Install local Nexus in you machine and add work Nexus as proxy
> repository
> >>> in it and then only one setting.xml works.
> >>> It also gives you freedom to work totally offline.
> >>>
> >>> Cheers,
> >>> Markku
> >>> On 09/24/2013 03:31 AM, Jamie Archibald wrote:
> >>>
> >>>  I typically work behind a Nexus server at work which I use a
> >>>> settings.xml
> >>>> file. When I come home I remove the settings.xml from my m2 folder.
> >>>>
> >>>> As soon as I do this I can no longer resolve my maven dependencies
> that
> >>>> are
> >>>> my work modules, even though they show up in my m2 repo.
> >>>>
> >>>> When I put the settings.xml back into my m2 repo the dependencies can
> >>>> resolve.
> >>>>
> >>>> This happens with both snapshots and non-snapshots.
> >>>>
> >>>> What am I missing here?
> >>>>
> >>>>
> >>>>  ------------------------------****----------------------------**
> >>> --**---------
> >>> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> >>> For additional commands, e-mail: users-h...@maven.apache.org
> >>>
> >>>
> >>>
> >
> > --
> > Ron Wheeler
> > President
> > Artifact Software Inc
> > email: rwhee...@artifact-software.com
> > skype: ronaldmwheeler
> > phone: 866-970-2435, ext 102
> >
> >
> > ------------------------------**------------------------------**---------
> > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> > For additional commands, e-mail: users-h...@maven.apache.org
> >
> >
>
> --
> Jamie
>

Reply via email to