Installing Bundles

In order to have your features from your bundle available as part of the repository manager, the bundle needs to be loaded by the OSGi container.

The default build assembles multiple bundles into features that form the foundation of Nexus Repository Manager OSS and Nexus Repository Manager Pro. A number of these definitions can be found in the assemblies module. The supported distributions are defined in the modules nexus-oss-feature and nexus-pro-feature, which are part of the internal code-base.

An installation of the repository manager defines the feature it loads in $data-dir/etc/nexus.properties and additional features can be declared to be loaded there. E.g. to add my-custom-feature to an Nexus Repository Manager OSS installation you can change to:

nexus-features=nexus-oss-feature,my-custom-feature

The feature my-custom-feature is a Maven project that includes the desired bundles as dependencies. Alternatively you can add a specific feature via Karaf commands.

Bundles can be loaded via the Karaf console. To enable the console, set karaf.startLocalConsole in bin/nexus.vmoptions to true. This allows you to access the Karaf console by pressing enter after starting the repository manager with the run option.

The bundle:install command can be used to load a bundle into the container.

For development usage, you can set the local Maven repository as the source for any bundle loading with e.g.

config:property-set -p org.ops4j.pax.url.mvn
org.ops4j.pax.url.mvn.defaultRepositories "file:${user.home}/.m2/repository@id=system.repository@snapshots"

Once your bundle is installed, it will be displayed as part of the output from bundle:list. With the local Maven repository configured as a source, you can rebuild your bundle and get it reloaded and the repository completed restarted with:

bundle:update 270
bundle:refresh
system:shutdown -f -r

This process ensures that bundles are updated, imports are correctly picking up any changes and the full repository manager runs through the full start-up life-cycle.