I'm running into what I think is a catch-22 situation the way my settings.xml file is set up.
Currently, when I'm in the office, I use our Nexus as our principal source. All repos are mirrored to Nexus, and Nexus, in turn, is a proxy for Central. Everything works fine. I am able to download artifacts from central, and those local to Nexus.
However, when I am out of the office, I no longer have access to the Nexus server. So I changed my settings.xml file to disable the mirror to central. However, now maven complains that it is unable to find local artifacts that are hosted on my Nexus even though they exist in my local m2 repo.
I know that Maven 3 tracks the location from which the artifact was downloaded with the _maven.repositories file (see this post as well as other resources). However, I am not sure how I am supposed to configure my issue such that I can move around like this.
When I am out of the office, I don't have access to my Nexus, but want to continue using my local repo for artifacts that were previously cached. But I do not want to turn Maven offline altogether as I need to d/l other artifacts from Central to continue working.
settings.xml when at office
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>https://nexus.local/nexus/content/groups/public/</url>
</mirror>
</mirrors>
settings.xml when out of office:
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*,!central</mirrorOf>
<url>https://nexus.local/nexus/content/groups/public/</url>
</mirror>
</mirrors>
Should my mirror be configured differently? Is there a better way to set this up? I realize that I can just delete my _maven.repositories
file, but that is not particularly practical nor, I'm sure, advisable.