Jump to: navigation, search

Difference between revisions of "Tycho/Nexus Unzip Plugin"

(Configuring an unzip repository (using hosted/proxy/virtual repo as master))
(Configuring an unzip repository (using hosted/proxy/virtual repo as master))
Line 42: Line 42:
 
#Select the intended repository from the list of the source nexus repositories (see below if you want to configure a group as source repository)
 
#Select the intended repository from the list of the source nexus repositories (see below if you want to configure a group as source repository)
 
#Save the repository config  
 
#Save the repository config  
#To verify the setup of the unzip repository, you can now select the repository from the repository list and start browsing the folders *and* into archives that you have deployed into the previously selected master repository. You can also open the URL given in the Repository Path column to browse in the standard web browser.
+
#To verify the setup of the unzip repository, you can now select the repository from the repository list and start browsing the folders '''and''' into archives that you have deployed into the previously selected master repository. You can also open the URL given in the Repository Path column to browse in the standard web browser.
  
 
=== Configuring a group as master for the unzip repository  ===
 
=== Configuring a group as master for the unzip repository  ===

Revision as of 13:21, 20 February 2013

WARNING - EARLY DRAFT: this plugin is not released yet and docs are in early draft and probably not complete/ buggy. If you want to try it, you will need to build the plugin yourself from source.


Nexus Unzip Repository

The Unzip Repository is a new Nexus repository type that shadows the build results of a standard Maven 2 repository and allows to browse into zip and jar artifacts. The use case is to offer p2 repositories that were built with Tycho packaging type eclipse-repository and deployed as zip to Nexus so that other Tycho projects can reference them.

Example:

  • p2 repo zip as artifact in Maven 2 Repository:
    http://<NEXUS_HOST>/nexus/content/repositories/public/org/example/demo/org.example.demo.repository/0.1.0/org.example.demo.repository-0.1.0.zip
  • Same artifact viewed as unzipped p2 repository using a virtual unzip repo named public.unzip:
    http://<NEXUS_HOST>/nexus/content/repositories/public.unzip/org/example/demo/org.example.demo.repository/0.1.0/org.example.demo.repository-0.1.0.zip-unzip


Installation and Configuration

Prerequisites

The Nexus Unzip Repository Plugin requires Nexus OSS >= 2.3.0 installed

Deploying the plug-in

To enable a Nexus server to provide direct access to files inside zip/jar archives you need to deploy the Nexus Unzip Repository Plugin to the Nexus server instance and configure a new virtual repository using the Unzip Repository type.

  1. Stop the Nexus instance
  2. Navigate to the plugin repository in the work dir ${NEXUS_WORK}/plugin-repository
  3. Unzip the unzip-repository-plugin-<VERSION>-bundle.zip into the plugin-repository/ folder
  4. Restart the Nexus server
  5. Verify that the Unzip Repository Plugin is activated, by opening the Plugin Console from the Administration sub-menu of the Nexus UI

Configuring an unzip repository (using hosted/proxy/virtual repo as master)

WARNING: Using the Nexus Web UI you can only assign hosted, proxy and virtual repositories as the master repository. To configure a group as the used master , you need to configure it directly in the configuration file on the Nexus host machine. Details in the section below.

  1. Open the Nexus Web UI
  2. Login with your administrative user
  3. Choose the Repositories View from the side menu
  4. Open the Add menu and choose Virtual Repository. The detail view below the repository list opens a form to specify further repository configuration.
  5. Enter a unique repository ID and choose a (display) name
  6. Choose Unzip Repository Template as the repository provider
  7. Select the intended repository from the list of the source nexus repositories (see below if you want to configure a group as source repository)
  8. Save the repository config
  9. To verify the setup of the unzip repository, you can now select the repository from the repository list and start browsing the folders and into archives that you have deployed into the previously selected master repository. You can also open the URL given in the Repository Path column to browse in the standard web browser.

Configuring a group as master for the unzip repository

All groups and repositories configuration are stored in the nexus.xml config file in the Nexus work folder. You need to edit this directly in a text editor to configure a group as master.

  1. Stop Nexus
  2. Open ${NEXUS_WORK}/conf/nexus.xml
  3. Add a new repository element with following structure
<repository>
      <id>master.group.unzip</id>
      <name>Group Unzip</name>
      <providerRole>org.eclipse.tycho.nexus.internal.plugin.UnzipRepository</providerRole>
      <providerHint>org.eclipse.tycho.nexus.plugin.DefaultUnzipRepository</providerHint>
      <localStatus>IN_SERVICE</localStatus>
      <notFoundCacheActive>true</notFoundCacheActive>
      <notFoundCacheTTL>15</notFoundCacheTTL>
      <userManaged>true</userManaged>
      <exposed>true</exposed>
      <browseable>true</browseable>
      <writePolicy>READ_ONLY</writePolicy>
      <searchable>true</searchable>
      <localStorage>
        <provider>file</provider>
      </localStorage>
      <externalConfiguration>
        <masterRepositoryId>public</masterRepositoryId>
        <useVirtualVersion>false</useVirtualVersion>
        <synchronizeAtStartup>false</synchronizeAtStartup>
      </externalConfiguration>
    </repository>

Note that you write the repository id (not the name) of the group in the masterRepositoryId element.
4. Restart Nexus