Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

sonatype-nexus-community/nexus-repository-p2

Repository files navigation

Nexus Repository Manger p2 Format

Maven Central CircleCI Join the chat at https://gitter.im/sonatype/nexus-developers DepShield Badge

Huzzah! p2 is now part of Nexus Repository Manager. Version 3.21 includes the p2 plugin by default. The plugin source code is now in nexus-public in nexus-repository-p2.

Filing issues: Upgrade to the latest version of Nexus Repository Manager 3, to get the latest fixes and improvements, before filing any issues or feature requests at https://issues.sonatype.org/.

Upgrading: If you are using a version prior to 3.21 and upgrade to a newer version you will not be able to install the community plugin. No other changes are required and your existing data will remain intact.

Table Of Contents

Developing

Requirements

Also, there is a good amount of information available at Bundle Development

Building

To build the project and generate the bundle use Maven

mvn clean package

If everything checks out, the bundle for p2 should be available in the target folder.

Build with Docker

docker build -t nexus-repository-p2:1.0.0 .

Run as a Docker container

docker run -d -p 8081:8081 --name nexus nexus-repository-p2:1.0.0

For further information like how to persist volumes check out the GitHub repo for our official image.

The application will now be available from your browser at http://localhost:8081

Using p2 With Nexus Repository Manager 3

We have detailed instructions on how to get started here!

Compatibility with Nexus Repository Manager 3 Versions

The table below outlines what version of Nexus Repository Manager the plugin was built against

Plugin Version Nexus Repository Manager Version
v0.0.2 3.8.0-02
v1.0.2 In product 3.21.0+

If a new version of Nexus Repository Manager is released and the plugin needs changes, a new release will be made, and this table will be updated to indicate which version of Nexus Repository Manager it will function against. This is done on a time available basis, as this is community supported. If you see a new version of Nexus Repository Manager, go ahead and update the plugin and send us a PR after testing it out!

All released versions can be found here.

Features Implemented In This Plugin

Feature Implemented
Proxy ✔️ *
Hosted
Group

NOTE: p2 Proxy does not fully support the following as of yet:

  • Old style (non-p2) update sites. These are fairly old, and have not been added at all.

If you'd like it to support the aforementioned sites, please file an issue, or better yet, submit a PR :)

Installing the plugin

‼️ After Nexus Repository Manager version 3.21, last released plugin's version is available directly in product and there is no need to install it separately ‼️

For older versions there are a range of options for installing the p2 plugin. You'll need to build it first, and then install the plugin with the options shown below:

Temporary Install

Installations done via the Karaf console will be wiped out with every restart of Nexus Repository Manager. This is a good installation path if you are just testing or doing development on the plugin.

  • Enable the NXRM console: edit <nexus_dir>/bin/nexus.vmoptions and change karaf.startLocalConsole to true.

    More details here: Bundle Development

  • Run NXRM's console:

    # sudo su - nexus
    $ cd <nexus_dir>/bin
    $ ./nexus run
    > bundle:install file:///tmp/nexus-repository-p2-1.0.0.jar
    > bundle:list
    

    (look for org.sonatype.nexus.plugins:nexus-repository-p2 ID, should be the last one)

    > bundle:start <org.sonatype.nexus.plugins:nexus-repository-p2 ID>
    

(more) Permanent Install

For more permanent installs of the nexus-repository-p2 plugin, follow these instructions:

  • Copy the bundle (nexus-repository-p2-1.0.0.jar) into <nexus_dir>/deploy

This will cause the plugin to be loaded with each restart of Nexus Repository Manager. As well, this folder is monitored by Nexus Repository Manager and the plugin should load within 60 seconds of being copied there if Nexus Repository Manager is running. You will still need to start the bundle using the karaf commands mentioned in the temporary install.

(most) Permanent Install

If you are trying to use the p2 plugin permanently, it likely makes more sense to do the following:

  • Copy the bundle into <nexus_dir>/system/org/sonatype/nexus/plugins/nexus-repository-p2/1.0.0/nexus-repository-p2-1.0.0.jar

  • Make the following additions marked with + to <nexus_dir>/system/org/sonatype/nexus/assemblies/nexus-core-feature/3.x.y/nexus-core-feature-3.x.y-features.xml

          <feature prerequisite="false" dependency="false">wrap</feature>
    +     <feature prerequisite="false" dependency="false">nexus-repository-p2</feature>
    

    to the <feature name="nexus-core-feature" description="org.sonatype.nexus.assemblies:nexus-core-feature" version="3.x.y.xy"> section below the last (above is an example, the exact last one may vary).

    And

    + <feature name="nexus-repository-p2" description="org.sonatype.nexus.plugins:nexus-repository-p2" version="1.0.0">
    +     <details>org.sonatype.nexus.plugins:nexus-repository-p2</details>
    +     <bundle>mvn:org.sonatype.nexus.plugins/nexus-repository-p2/1.0.0</bundle>
    + </feature>
     </features>
    

    as the last feature.

This will cause the plugin to be loaded and started with each startup of Nexus Repository Manager.

The Fine Print

Starting from version 3.21 the p2 plugin is supported by Sonatype, but still is a contribution of ours to the open source community (read: you!).

Remember:

  • Do file Sonatype support tickets related to p2 support in regard to this plugin

Phew, that was easier than I thought. Last but not least of all:

Have fun creating and using this plugin and the Nexus platform, we are glad to have you here!

Getting help

Looking to contribute to our code but need some help? There's a few ways to get information: