Skip to content
This repository has been archived by the owner on Oct 20, 2018. It is now read-only.

Standard Repository Build

hmalphettes edited this page Jun 16, 2011 · 8 revisions

A standard repository build generates one or more p2 repositories that contain artifacts and metadata. The tycho-p2-scripts invoke http://eclipse.org/tycho/ maven-tycho and deploy the generated repositories on the file system.

Anatomy of a generated build

${HTTPD_ROOT_PATH}                     # Env variable: path on the file system. by default $HOME/p2repo
  $groupID{.optional_repositorySuffix} # groupId and optional suffix to differentiate multiple repos
                                       # with the same groupId
    ${branchName}
      ${version.buildNumber}           
        plugins/                       # part of the usual p2repository; contains the OSGi bundles
        features/                      # part of the usual p2repository; contains the eclipse features
        binaries/                      # part of the usual p2repository; contains the configuration files
        debs/                          # optional: the folder that contains the deb packages of this build
        artifacts.jar                  # p2: artifacts list
        content.jar                    # p2: metadata: constraints of each artifact
      current                          # symbolic-link that points at the latest version-ed folder

Build number

tycho-p2-scripts expects a few elements in the root pom.xml to be present in order to support its operations.

The build number is stored inside the pom.xml as the commented property forceContextQualifier:

<properties>
  <!-- the commented forceContextQualifier is in fact the build number
  It is required in this format for the scripts to find it -->
  <!--forceContextQualifier>024</forceContextQualifier-->

The completeVersion is

completeVersion=${version}.${forceContextQualifier}

Note that it is a best practice to pad the build numbers with ‘0s’.

Where version is computed from the <version> element in the root pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"..>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.intalio.my.group.id</groupId>
  <version>1.0.0-SNAPSHOT</version>

The ‘-SNAPSHOT’ is removed and that is the value of the version. So in this example:

completeVersion=1.0.0.024

Location of the deployed repositories

The repositories are deployed on the file system on this path:

${HTTPD_ROOT_PATH}/{$groupId_path}${optional_repositorySuffix}/${BRANCH}/${completeVersion}

Where groupId_path is defined in the root pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0"..>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.intalio.my.group.id</groupId>

And transformed into a path by replacing the ‘.’ by ‘/’. For example:

org/intalio/my/group/id

The optional_repositorySuffix is required if the build produces multiple repositories. Otherwise it is optional. It is defined directly as the property repositorySuffix in the pom.xml where the repository is created:

<project>
  <!-- ... -->
  <packaging>eclipse-repository</packaging>
  <properties>
    <repositorySuffix>gpl</repository>
  </properties>

When the property repositorySuffix is defined optional_repositorySuffix is computed in this manner:

optional_repositorySuffix=.${repositorySuffix}

So in this example the ‘gpl’ repo is deployed here:

$HOME/p2repo/org/intalio/my/group/id.gpl/master/1.0.0.0024