When we're at a hackfest (especially somewhere with not-the-best WiFi or upstream connection) or inviting many new developers to participate, saving them the anguish of 1.5GB of development dependencies over a flaky connection is nice of us and save our upstream bandwidth for important things (like Google Hangouts). We can do this by setting up a Nexus proxy server.

Get Nexus

Download Nexus OSS from http://www.sonatype.org/nexus/go and deploy it to a server, and launch the WAR.

Configure Proxy repositories

Add PROXY repositories for:

Add these to the Public Repositories group.

 

Settings for Developers to use the Mirror

In order to use the mirror, everyone needs to add the <mirror> snippet below to their Maven settings.xml file (generally found in ~/.m2/settings.xml). 

<?xml version="1.0" encoding="UTF-8"?>
<!--
    User-specific configuration for maven. Includes things that should not 
    be distributed with the pom.xml file, such as developer identity, along with 
    local settings, like proxy information. The default location for the
    settings file is ~/.m2/settings.xml 
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
 
    <mirror>
 
     <id>fcrepo4or</id>
 
     <mirrorOf>central,jboss-public-repository-group,maven2-repository.dev.java.net,fcrepo-snapshot,fcrepo-thirdparty</mirrorOf>
 
     <url>http://or.fcrepo.org/nexus/content/groups/public/</url>
 
    </mirror>
 
 </mirrors>
</settings>

 

Populating the mirror

The first time you request an artifact from the mirror, it will fetch it from upstream. One good way to do this is to mvn install the fcrepo4/fcrepo-webapp project and fcrepo-kitchen-sink.

  • No labels