Donnerstag, 25. September 2014

HowTo: Host P2 repositories built by Tycho on Nexus

Introduction

In the following we are going to set up a Sonatype Nexus server which will provide p2 repositories. Besides proxying an existing p2 repository the Nexus server will host its own. For this purpose we will create a p2 repository from simple Maven dependencies using Tycho. As dependencies we take the libs from earlier Logging HowTo to cover a real use case. In the end a simple mvn deploy will get everything done.

Prerequesites

Steps

Setup Nexus

  1. Download Sonatype Nexus (this HowTo was done with version 2.9.1-02 but should work from version 2.8.x onwards).
  2. Download additional Nexus plugins (choose the xxx-bundle.zip files)
  3. Unzip the downloaded bundles to <NEXUS_HOME>/nexus/WEB-INF/plugin-repository
  4. Start Nexus console by running <NEXUS_HOME>/bin/nexus console
  5. Access Nexus
  6. Check the status of the installed plugins via plugin console (default credentials admin//admin123).
  7. Proxy Eclipse Luna p2 repository.
    1. Add a new Proxy Repository.
    2. Configure the Proxy Repository.
  8. Host logging repository as maven2 repository.
    1. Add a new Host Repository.
    2. Configure the Host Repository.
  9. Host logging repository as p2 repository.
    1. Add a new Virtual Repository.
    2. Configure the Virtual Repository.
  10. Enable virtual versions in <NEXUS_WORK>/conf/nexus.xml and restart Nexus.

Setup Tycho driven p2 repository project

  1. Create pom.xml file.
    Note: Check Tom Bujok's p2-maven-plugin if you plan to use Maven dependencies which are not OSGi bundles yet.
  2. Define a category.xml file and place it next to the pom file.
  3. Adjust your Maven settings.
  4. Call mvn deploy.

Use the p2 repository

Finally open your Eclipse IDE and add the Logging p2 repository as Software Site.

References

  • http://wiki.eclipse.org/Tycho/Nexus_Unzip_Plugin

1 Kommentar: