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
- Installed Maven
Steps
Setup Nexus
- Download Sonatype Nexus (this HowTo was done with version 2.9.1-02 but should work from version 2.8.x onwards).
- Download additional Nexus plugins (choose the xxx-bundle.zip files)
- Nexus P2 Bridge Plugin (choose the same version like Nexus version)
- Nexus P2 Repository Plugin (choose the same version like Nexus version)
- Nexus Unzip Plugin (at least version 0.14.0)
- Unzip the downloaded bundles to <NEXUS_HOME>/nexus/WEB-INF/plugin-repository
- Start Nexus console by running <NEXUS_HOME>/bin/nexus console
- Access Nexus.
- Check the status of the installed plugins via plugin console (default credentials admin//admin123).
- Proxy Eclipse Luna p2 repository.
- Add a new Proxy Repository.
- Configure the Proxy Repository.
- Host logging repository as maven2 repository.
- Add a new Host Repository.
- Configure the Host Repository.
- Host logging repository as p2 repository.
- Add a new Virtual Repository.
- Configure the Virtual Repository.
- Enable virtual versions in <NEXUS_WORK>/conf/nexus.xml and restart Nexus.
Setup Tycho driven p2 repository project
- 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. - Define a category.xml file and place it next to the pom file.
- Adjust your Maven settings.
- 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







You saved me, working like a charm. Amazing!
AntwortenLöschen