Fork me on GitHub

tycho-p2-repository:assemble-maven-repository

Full name:

org.eclipse.tycho:tycho-p2-repository-plugin:6.0.0-SNAPSHOT:assemble-maven-repository

Description:

This goals produces a "p2-maven-site" from the projects declared <dependencies> (and <dependencyManagement> if desired). A p2-maven-site is completely manageable by standard maven tools and has the following properties:

  • The artifacts are not stored in the site itself but referenced as maven-coordinates, that means you don't have to upload your artifacts to a dedicated place, everything is fetched from the maven repository
  • The metadata of the page is attached to the current project with type=zip and classifier=p2site and could be deployed using standard maven techniques
Please note: Only valid OSGi bundles are included, there is no way to automatically wrap plain jars and they are silently ignored. This is intentional, as the goal of a p2-maven-site is to use exactly the same artifact that is deployed in the maven repository.

The produced p2-maven-site can then be consumed by Tycho or PDE targets in the following ways. Note that m2eclipse is required for IDE (PDE Target Editor) support.

Option 1 – POM <repositories> section (adds the entire site to the target platform):

<repository>
<id>my-p2-maven-site</id>
<url>mvn:[groupId]:[artifactId]:[version]:zip:p2site</url>
<layout>p2</layout>
</repository>

Option 2 – .target file InstallableUnit location (recommended; allows fine-grained unit selection):

 <location includeAllPlatforms="false" includeConfigurePhase="true"
           includeMode="planner" includeSource="true" type="InstallableUnit">
     <repository location="mvn:[groupId]:[artifactId]:[version]:zip:p2site"/>
     <!-- list desired units here -->
 </location>
The same mvn: URL scheme works for any zip artifact that contains a valid p2 repository (i.e. content.xml/content.jar and artifacts.xml/ artifacts.jar), not only for zips produced by this goal. This means you can also consume a self-contained p2 repository zip that was exported from the Eclipse IDE or built with another tool, as long as it was deployed to a Maven repository.

Important: Do not use <location type="Maven"> for this purpose. That location type resolves Maven JARs as plain OSGi bundles and is not intended for consuming p2 repositories.

The Maven artifact referenced by a mvn: URL must be resolvable from the local Maven repository or from a remote repository configured in the project's <repositories> section. The mvn: URL itself does not carry repository location or authentication information.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • The goal is not marked as thread-safe and thus does not support parallel builds.

Required Parameters

Name Type Since Description
<buildDirectory> File - The output directory of the jar file By default this is the Maven "target/" directory.
User Property: project.build.directory

Optional Parameters

Name Type Since Description
<categoryFile> File - Location of the category definition. If the file does not exist, a generic category definition is generated including all bundles under one category
Default: ${project.basedir}/category.xml
<categoryName> String - Name for the automatically generated category
Default: Bundles
<destination> File - No description.
Default: ${project.build.directory}/repository
<failOnResolveError> boolean - No description.
Default: false
<includeDependencies> boolean - Flag whether declared <dependencies> of the projects should be included.
Default: true
<includeManaged> boolean - Flag that controls if <dependencyManagement> managed dependencies should be included, this is useful if your are using a BOM and like to include all materials in the update-site regardless of if they are explicitly included in the <dependencies> section
Default: false
<includePGPSignature> boolean - If enabled, PGP signatures of the artifacts are embedded in the P2 site to allow for additional verifications / trust decisions
Default: false
<includeReactor> boolean - Flag that controls if reactor projects should be considered, this is useful if your are simply like to make an update side of all your current reactor projects
Default: false
<includeTransitiveDependencies> boolean - Flag whether dependencies of the projects declared <dependencies> (and <dependencyManagement> if desired) should be included. If enabled this creates the maven equivalent of a self-contained P2 site
Default: false
<includeTransitiveDependenciesScopes> Set<String> - List what scopes should be considered when including transitive dependencies, defaults to compile. In contrast to what maven does, scopes are not inclusive, that means for example that test does not include ! If you want that specify both scopes here.
Default: compile
<keyServerRetry> int - Key servers are sometimes busy, this configures the maximum amount of retries to fetch the public key before failing the build
Default: 10
<keyServerUrls> List<String> - Configures the key servers that are used to fetch the public keys, if not specified, "https://keyserver.ubuntu.com/pks/lookup?op=get&search={0}" and "http://pgp.mit.edu/pks/lookup?op=get&search={0}" are used in this order.
<outputTimestamp> String - Timestamp for reproducible output archive entries, either formatted as ISO 8601 extended offset date-time (e.g. in UTC such as '2011-12-03T10:15:30Z' or with an offset '2019-10-05T20:37:42+06:00'), or as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).
Default: ${project.build.outputTimestamp}
<timeoutInSeconds> int - No description.
Default: 300

Parameter Details

<buildDirectory>

The output directory of the jar file By default this is the Maven "target/" directory.
  • Type: java.io.File
  • Required: Yes
  • User Property: project.build.directory

<categoryFile>

Location of the category definition. If the file does not exist, a generic category definition is generated including all bundles under one category
  • Type: java.io.File
  • Required: No
  • Default: ${project.basedir}/category.xml

<categoryName>

Name for the automatically generated category
  • Type: java.lang.String
  • Required: No
  • Default: Bundles

<destination>

No description.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/repository

<failOnResolveError>

No description.
  • Type: boolean
  • Required: No
  • Default: false

<includeDependencies>

Flag whether declared <dependencies> of the projects should be included.
  • Type: boolean
  • Required: No
  • Default: true

<includeManaged>

Flag that controls if <dependencyManagement> managed dependencies should be included, this is useful if your are using a BOM and like to include all materials in the update-site regardless of if they are explicitly included in the <dependencies> section
  • Type: boolean
  • Required: No
  • Default: false

<includePGPSignature>

If enabled, PGP signatures of the artifacts are embedded in the P2 site to allow for additional verifications / trust decisions
  • Type: boolean
  • Required: No
  • Default: false

<includeReactor>

Flag that controls if reactor projects should be considered, this is useful if your are simply like to make an update side of all your current reactor projects
  • Type: boolean
  • Required: No
  • Default: false

<includeTransitiveDependencies>

Flag whether dependencies of the projects declared <dependencies> (and <dependencyManagement> if desired) should be included. If enabled this creates the maven equivalent of a self-contained P2 site
  • Type: boolean
  • Required: No
  • Default: false

<includeTransitiveDependenciesScopes>

List what scopes should be considered when including transitive dependencies, defaults to compile. In contrast to what maven does, scopes are not inclusive, that means for example that test does not include ! If you want that specify both scopes here.
  • Type: java.util.Set<java.lang.String>
  • Required: No
  • Default: compile

<keyServerRetry>

Key servers are sometimes busy, this configures the maximum amount of retries to fetch the public key before failing the build
  • Type: int
  • Required: No
  • Default: 10

<keyServerUrls>

Configures the key servers that are used to fetch the public keys, if not specified, "https://keyserver.ubuntu.com/pks/lookup?op=get&search={0}" and "http://pgp.mit.edu/pks/lookup?op=get&search={0}" are used in this order.
  • Type: java.util.List<java.lang.String>
  • Required: No

<outputTimestamp>

Timestamp for reproducible output archive entries, either formatted as ISO 8601 extended offset date-time (e.g. in UTC such as '2011-12-03T10:15:30Z' or with an offset '2019-10-05T20:37:42+06:00'), or as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).
  • Type: java.lang.String
  • Required: No
  • Default: ${project.build.outputTimestamp}

<timeoutInSeconds>

No description.
  • Type: int
  • Required: No
  • Default: 300