<div dir="ltr">Hi Dscho and everyone,<div><br></div><div><div>> It is a pity that we cannot configure the mirror from the pom-scijava</div><div>> parent (which would have relieved every developer from having to</div>

<div>> configure the *exact* *same* thing on their computers), but at least</div><div>> it is easy enough.</div></div><div><br></div><div>For what it's worth, what we *can* do is switch pom-scijava to use the ImageJ "public" group (<a href="http://maven.imagej.net/content/groups/public">http://maven.imagej.net/content/groups/public</a>) as the sole repository. This means by default, everyone's Maven builds check only two repositories: Central and ImageJ public. Further, if/when we need to introduce access to additional repositories and/or remove obsolete ones, we don't have to hack the POM anymore; we can just update our Nexus configuration. That way everyone automatically benefits from such changes with no action required.</div>

<div><br></div><div>Until recently, our Nexus was also misconfigured to not do proper bookkeeping: it was not updating its indices or emptying its trash. Now that I have things set up correctly, everything is kept up to date, and the mirror feature Johannes mentioned works for developers who care to configure it in their ~/.m2/settings.xml.</div>

<div><br></div><div>Regards,</div><div>Curtis</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jan 15, 2014 at 11:35 AM, Johannes Schindelin <span dir="ltr"><<a href="mailto:schindelin@wisc.edu" target="_blank">schindelin@wisc.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Curtis,<br>
<br>
I got curious about the "remote proxy" feature of Nexus (which is used to<br>
serve ImageJ's Maven repository). For the benefit of other developers, let<br>
me write it up here:<br>
<br>
When clicking on the "Repositories" link on the left hand side menu of<br>
<a href="http://maven.imagej.net/" target="_blank">http://maven.imagej.net/</a> you see a lot of repositories with basically<br>
four types: "group", "hosted", "virtual" and "proxy":<br>
<br>
        <a href="http://maven.imagej.net/index.html#view-repositories" target="_blank">http://maven.imagej.net/index.html#view-repositories</a><br>
<br>
The "hosted" ones are our repositories, to which we deploy: snapshots,<br>
releases and thirdparty (for dependencies we rely on that were not<br>
deployed anywhere yet).<br>
<br>
The "virtual" repositories are there only for compatibility and we could<br>
even switch them off because we do not support Maven 1 at all.<br>
<br>
The proxy repositories are interesting: when accessing them via Maven,<br>
they try to retrieve the desired artifacts from remote repositories and<br>
keep cached copies (eternally for release versions, 24 minutes for<br>
snapshots) so that they serve the artifacts from the cache until expired.<br>
<br>
The groups are just aggregating others, and the most important group is<br>
the "public" one: it offers a single, public-facing repository that serves<br>
*all* of the public repositories, including the proxy ones.<br>
<br>
Now, the real cool thing about it is that you can configure your local<br>
Maven to use the "public" group repository as a *mirror*, i.e. instead of<br>
looking here and there and everywhere for artifacts, it looks only at the<br>
"public" repository and lets that one worry about retrieving the<br>
artifacts. It also makes things faster because Maven will only have to<br>
look at one single repository rather than trying a couple of them.<br>
<br>
To configure the mirror, I added the <mirrors> section to my<br>
$HOME/.m2/settings.xml:<br>
<br>
-- snip --<br>
<settings><br>
        ...<br>
        <mirrors><br>
                <mirror><br>
                        <id>imagej-mirror</id><br>
                        <name>ImageJ's public mirror repository</name><br>
                        <url><a href="http://maven.imagej.net/content/groups/public" target="_blank">http://maven.imagej.net/content/groups/public</a></url><br>
                        <mirrorOf>*</mirrorOf><br>
                </mirror><br>
        </mirrors><br>
        ...<br>
</settings><br>
-- snap --<br>
<br>
It is a pity that we cannot configure the mirror from the pom-scijava<br>
parent (which would have relieved every developer from having to configure<br>
the *exact* *same* thing on their computers), but at least it is easy<br>
enough.<br>
<br>
Maybe we should teach the imagej-maven-plugin to edit the user's<br>
configuration when the user asks for it?<br>
<br>
Ciao,<br>
Dscho<br>
</blockquote></div><br></div>