Setting Up a Maven Proxy

From OpenNMS

This will discuss setting up the Nexus Maven proxy.

Install Nexus

First, install Nexus. Nexus has excellent documentation on the subject.

Follow the directions in section 16.2 and you'll have a basic install set up.

Configure Repositories

To add a repository, log in to http://nexus-server:8081/nexus/ (login/password are admin/admin123 by default) and then click the "Repositories" link in the navigation menu on the left.

Then, click the +Add button at the top.

You will need to add the following repositories to be able to do full OpenNMS development (anything not listed here can be left as the defaults):

  • Agile Java
    • Repository ID: agile-repo
    • Repository Name: AgileJava Maven2 Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://agilejava.com/maven
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • Atlassian
    • Repository ID: atlassian-m2-repo
    • Repository Name: Atlassian Maven2 Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://repository.atlassian.com/maven2
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • JavaNet Maven1 Release
    • Repository ID: java-net-maven1-repo
    • Repository Name: JavaNet Maven1 Release Repo
    • Repository Type: proxy
    • Format: maven1
    • Repository Policy: Release
    • Remote Storage Location: http://download.java.net/maven/1
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • JavaNet Maven1 Snapshots
    • Repository ID: java-net-maven1-snapshots
    • Repository Name: JavaNet Maven1 Snapshots
    • Repository Type: proxy
    • Format: maven1
    • Repository Policy: Snapshot
    • Remote Storage Location: http://download.java.net/maven/1
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • JavaNet Maven2 Release
    • Repository ID: java-net-maven2-repo
    • Repository Name: JavaNet Maven2 Release Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://download.java.net/maven/2
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • JavaNet Maven2 Snapshot
    • Repository ID: java-net-maven2-snapshots
    • Repository Name: JavaNet Maven2 Snapshot Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Snapshot
    • Remote Storage Location: http://download.java.net/maven/2
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • JBoss Drools
    • Repository ID: jboss-repo
    • Repository Name: JBoss Drools Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://repository.jboss.com/maven2
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • JRadius
    • Repository ID: jradius-coova-repo
    • Repository Name: JRadius Third Party Dependencies
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://dev.coova.org/mvn
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • OpenNMS Maven2 Release
    • Repository ID: opennms-repo
    • Repository Name: OpenNMS Maven2 Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://repo.opennms.org/maven2
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • OpenNMS Maven2 Snapshot
    • Repository ID: opennms-snapshots
    • Repository Name: OpenNMS Snapshot Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Snapshot
    • Remote Storage Location: http://repo.opennms.org/snapshots
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • OpenNMS Releases
    • Repository ID: opennms-releases
    • Repository Name: OpenNMS Release Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://repo.opennms.org/releases
    • Download Remote Indexes: True
    • Checksum Policy: Warn
  • OpenOSS
    • Repository ID: openoss-repo
    • Repository Name: OpenOSS Maven2 Repository
    • Repository Type: proxy
    • Format: maven2
    • Repository Policy: Release
    • Remote Storage Location: http://openoss.sourceforge.net/m2repo
    • Download Remote Indexes: True
    • Checksum Policy: Warn

Configure Maven2 settings.xml

Next, you'll need to set up your ~/.m2/settings.xml to point to your newly-created nexus mirror.

If you have a <mirror> section already, you will need to determine what these should override yourself. Otherwise, you should be able to edit your settings.xml like so:

 <settings>
   <mirrors>
     <mirror>
       <id>nexus-snapshots</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/public-snapshots</url>
       <mirrorOf>opennms-snapshots</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus-java-net-maven2-mirror</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/java-net-maven2</url>
       <mirrorOf>java-net-maven2-repo</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus-java-net-maven2-mirror</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/java-net-maven2</url>
       <mirrorOf>maven2-repository.dev.java.net</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus-java-net-maven2-mirror</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/java-net-maven2</url>
       <mirrorOf>m2.dev.java.net</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus-java-net-maven1-mirror</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/java-net-maven1</url>
       <mirrorOf>java-net-maven1-repo</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus-java-net-maven1-mirror</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/java-net-maven1</url>
       <mirrorOf>maven-repository.dev.java.net</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus-java-net-maven1-mirror</id>
       <name>Nexus Public Snapshots Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/java-net-maven1</url>
       <mirrorOf>m1.dev.java.net</mirrorOf>
     </mirror>
     <mirror>
       <id>nexus</id>
       <name>Nexus Public Release Mirror</name>
       <url>http://nen.opennms.org:8081/nexus/content/groups/public</url>
       <mirrorOf>*</mirrorOf>
     </mirror>
   </mirrors>
 </settings>
Personal tools
DevJam 2008 Sponsors
DevJam 2008 Sponsor: Google
DevJam 2008 Sponsor: Netregistry
DevJam 2008 Sponsor: Papa John's
NewEdge Networks
OpenNMS takes home the gold award!
Join the Free Software Foundation
Support This Project Commercial OpenNMS Support OpenNMS Italia Get OpenNMS at SourceForge.net. Fast, secure and Free Open Source software downloads Our Network Simulator Our Java Profiler