Skip to content
Jens Reimann edited this page Mar 23, 2015 · 1 revision

First of all, have a look at the test projects in the repository (the ones starting with "test.")

Basic Concepts

Channels

Channels are containers for software artifacts. Each channel has a unique ID an optionally a unique alias name. The name can be changed later, the ID not.

Channel Aspects

Each channel can have multiple channel aspects. These are extensions to the channel.

Functionality

Channel aspects can contribute by:

  • Extracting metadata from the artifact
  • Creating virtual artifacts which are bound to the stored artifact
  • Listen to change events in the channel and veto artifact creation

Available Aspects

At the moment there are the following channel aspects available:

  • Hasher - Provides a meta data extractor which generates MD5, SHA1, SHA256 and SHA512. Provides virtual artifacts for all stored artifacts with the name .md5, containing only the MD5 sum in hex
  • Mime - Extract the mime type of the artifact
  • OSGi - Extract OSGi bundle and Eclipse feature information
  • Tycho Cleaner - Block uploading of maven tycho meta data an artifact files for P2
  • P2 Repository - This aspect will identify metadata information which can be used for creating a P2 respository view

Technical realization

Aspects implement the interface ChannelAspectFactory which creates objects of the type ChannelAspect. The ChannelAspect interface provides get methods for all extension points the aspect can be part of.

The ChannelAspectFactory is registered as an OSGi service with the following properties:

  • service.id - The name of the aspect, shown in the UI
  • service.description - A descriptive text, show in the UI
  • pm.aspect.id - The ID of the aspect, used internally

Note that a new artifact can only be created if all configured aspects are available during runtime.

Adaptors

Adaptors allow access to the repository beside the standard web UI on http://localhost:8080/.

P2

Provides read access to channels as a P2 repository. The main URL is http://localhost:8080/p2.

The P2 adaptor can create an p2.index file and metadata and artifacts information in compressed and uncompressed format. It builds up the repository based on the "-p2metadata.xml" and "-p2artifacts.xml" files. Which can either be present due to an upload by Maven Tycho, or can be created by letting the OSGi aspect extract the metadata and build the files as virtual artifacts.

Maven

Provides write access to channels as a Maven 2 repository. The main URL is http://localhost:8080/maven.

Stores uploaded files in the channel and attaches some metadata like group id, artifact id, version, snapshot information.

An example

  • Create a new channel
  • Add the following aspects
  • Hasher
  • Mime
  • OSGi
  • P2 Repository
  • Edit the channel an name it "test"
  • Create and assign at least one Deploy group and key

Configure Maven Tycho

Configure maven to use the deploy credentials (settings.xml):

…
<server>
  <id>test</id>
  <username>deploy</username>
  <password><!-- your deploy key here--></password>
</server>
…

Deploy your bundles and features (not repositories or products) using:

<distributionManagement>
	<repository>
		<id>test</id>
		<url>http://localhost:8080/maven/test</url>
	</repository>
</distributionManagement>

and

mvn deploy

Configure P2

Use http://localhost:8080/p2/test as repository URL for P2.