Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox/p2/Publisher"

< Equinox‎ | p2
(Features and Bundles Publisher Task)
(Ant Tasks)
Line 125: Line 125:
  
 
===Product Publisher Task===
 
===Product Publisher Task===
 +
The Product Publisher Task (p2.publish.product) is an ant task that is capable of generating product configuration metadata. The product publisher does not publish the bundles or features that constitute the product. Here is an example of how the ant task can be used:
 +
 +
<source lang=xml>
 +
  <p2.publish.product
 +
    metadataRepository="file:/repository/location"
 +
    artifactRepository="file:/repository/location"
 +
    publishArtifacts="true"
 +
    compress="true"
 +
    flavor="tooling"
 +
    executables="/delta/pack/location/eclipse/features/org.eclipse.equinox.executable_3.3.200.v20090507-7M-Fm-FI3UouOdgtbIvrva"
 +
    productFile="/product/file/location/sample.product">
 +
        <config ws="gtk" os="linux" arch="x86" />
 +
  </p2.publish.product>
 +
</source>
 +
 +
In addition to the default arguments, the product publishing task supports the following:
 +
<table border="5" cellspacing="0" cellpadding="1" width="95%" align="center">
 +
<tr><td><tt>flavor</tt></td><td>Set the flavor for the p2 metadata, default is "tooling".  Products should consider using a unique flavor if they have special requirements for bundle start levels.</td></tr>
 +
<tr><td><tt>productFile</tt></td><td>The location of the .product file describing the product.</td></tr>
 +
<tr><td><tt>executables</tt></td><td>The location of the executables feature.  This is the feature that is used for branding and publishing the executable</td></tr>
 +
<tr><td><tt>&lt;config&gt;</tt></td><td>Nested elements specifying configurations supported by this product. Config elements specify ws, os & arch:
 +
<div align="center"><tt>&lt;config ws="gtk" os="linux" arch="x86" /&gt;</tt></div>
 +
</td></tr>
 +
<tr><td><tt>&lt;advice&gt;</tt></td><td>Nested elements specifying specifying additional advice to use when creating the product.  Currently the accepted kinds of advice are "featureVersions" and "pluginVersions".
 +
<div align="center"><tt>&lt;advice kind="featureVersions" file="finalFeaturesVersions.properties" /&gt;<br>&lt;advice kind="pluginVersions" file="finalPluginsVersions.properties" /&gt;</tt></div>
 +
PDE/Build will generate these version properties files when the builder sets the property <a href="pde_version_qualifiers.htm#final_versions"><tt>generateVersionsLists</tt>"</a>.
 +
</td></tr>
 +
</table>
  
 
== PDE Build ==
 
== PDE Build ==

Revision as of 17:57, 1 June 2009

The Publisher is the means by which deployable entities get added to repositories. It consists of an extensible set of publishing actions, applications and Ant tasks that allow users to generate p2 repositories from a number of different sources.

Headless Applications

The Publisher consists of a number of headless (no GUI) Eclipse Applications that can be used to generate metadata from a variety of sources. Examples of such applications include:

  • FeaturesAndBundles Publisher: Generates metadata from a set of features and bundles
  • Product Publisher: Generates metadata from a .product file
  • Category Publisher: Generates categories for an existing repository
  • UpdateSite Publisher: Generates metadata from an UpdateSite
  • Install Publisher: Generates metadata from an existing Eclipse install

UpdateSite Publisher Application

The UpdateSite Publisher Application (org.eclipse.equinox.p2.publisher.UpdateSitePublisher) is a headless application that is capable of generating metadata (p2 repositories) from an update site containing a site.xml, bundles and features. The application can be invoked as follows:

 java -jar <targetProductFolder>/plugins/org.eclipse.equinox.launcher_*.jar
 -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher
 -metadataRepository file:/<some location>/repository
 -artifactRepository file:/<some location>/repository
 -source /<location with a site.xml>
 -configs gtk.linux.x86
 -compress 
 -publishArtifacts

Features And Bundles Publisher Application

The Features and Bundles Publisher Application (org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher) is a headless application that is capable of generating metadata (p2 repositories) from pre-build Eclipse bundles and features. The application can be invoked as follows:

   java -jar <targetProductFolder>/plugins/org.eclipse.equinox.launcher_*.jar
   -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher
   -metadataRepository file:/<some location>/repository
   -artifactRepository file:/<some location>/repository
   -source /<location with a plugin and feature directory>
   -configs gtk.linux.x86
   -compress
   -publishArtifacts

In this example, the plugins in /<location with a plugin and feature directory>/plugins and features in /<location with a plugin and feature directory>/features will be published in the file:/<some location>/repository repository. The artifacts will also be published, and the repositories (artifacts.xml and content.xml) compressed.

Product Publisher

The Product Publisher Application (org.eclipse.equinox.p2.publisher.ProductPublisher) is a headless application that is capable of generating product configuration metadata. The product publisher does not publish the bundles or features that constitute the product. The application can be invoked as follows:

   -console -consolelog -application org.eclipse.equinox.p2.publisher.ProductPublisher
   -metadataRepository file:/home/irbull/Desktop/temp/mail1
   -artifactRepository file:/home/irbull/Desktop/temp/mail1
   -productFile /home/irbull/workspaces/p2/mail/mail.product
   -append
   -publishArtifacts
   -executables /home/irbull/eclipse/delta/eclipse/features/org.eclipse.equinox.executable_3.3.200.v20090426-1530-7M-Fm-FI3UouOdcoUJz-7oc
   -flavor tooling
   -configs gtk.linux.x86

Note: There are currently a few oustanding (but workable) issues with this application:

  • You must list any bundles to start on the configuration tab.
  • Any features / bundles should be specified with "Exact" versions (no qualifiers) or 0.0.0 for latest
  • The executables feature must be specified
  • Flavor must be specified (if unsure, use tooling)
  • Unchecking "Include native launchers" has no effect

Category Publisher

The Category Publisher Application (org.eclipse.equinox.p2.publisher.CategoryPublisher) is a headless application that is capable of categorizing a set of Installable Units in a given repository. The categorization is driven from a category file. The application can be invoked as follows:

   -console -consolelog -application org.eclipse.equinox.p2.publisher.CategoryPublisher
   -metadataRepository file:/<repo location>/repository
   -categoryDefinition file:/home/irbull/workspaces/p2/mail/category.xml
   -categoryQualifier
   -compress

This application will use the categories defined in category.xml to categorize the metadata in file:/<repo location>/repository with the categories defined in category.xml. This command will compress the repository.

Ant Tasks

The publisher consists of two ant tasks for creating metadata. The first ant task (p2.publish.featuresAndBundles) is used to create metadata from pre-build bundles and features, while the second task (p2.publish.product) is used to create metadata from a .product file.

Default Attributes

The p2.publish.* ant tasks outlined below all support the following attributes:

metadataRepositoryA URL specifying the metadata repository to publish to.
artifactRepositoryA URL specifying the artifact repository to publish to.
repositorySets both metadataRepository and artifactRepository.
metadataRepositoryNameWhen creating a new metadata repository, sets the name.
artifactRepositoryNameWhen creating a new artifact repository, sets the name.
repositoryNameSets both metadataRepositoryName and artifactRepositoryName.
appendWhether to append to the repository. (Default is "true")
compressWhen creating a new repository, whether or not to compress the metadata. (Default is "false")
publishArtifactsWhether or not to publish the artifacts. (Default is "true")
reusePackedFilesWhether or not to include discovered Pack200 files in the repository. (Default is "false")
<contextRepository> Nested elements specifying context repositories, supports the following attributes:
locationA URL specifying the location of the repository.
artifact"true" or "false": whether or not there is an artifact repository at this location.
metadata"true" or "false": whether or not there is a metadata repository at this location.

If a given context repository contains metadata for one of the features or bundles that are being published, then that metadata will be re-used instead of generating new metadata.

Features and Bundles Publisher Task

The Features and Bundles Publisher Task (p2.publish.featuresAndBundles) is an ant task that is capable of generating metadata (p2 repositories) from pre-build Eclipse bundles and features. Here is an example of how the ant task can be used:

  <p2.publish.featuresAndBundles
    metadataRepository="file:/repository/location"
    artifactRepository="file:/repository/location"
    publishArtifacts="true"
    compress="true"
    source="/bundles/and/features/location/">

In addition to the default arguments, the feature and bundles task supports the following:

sourceA folder containing plugins and features subfolders to publish.
<features>A nested fileset element specifying the locations of binary features to publish.
<bundles>A nested fileset element specifying the locations of binary plug-ins to publish.

Product Publisher Task

The Product Publisher Task (p2.publish.product) is an ant task that is capable of generating product configuration metadata. The product publisher does not publish the bundles or features that constitute the product. Here is an example of how the ant task can be used:

  <p2.publish.product
    metadataRepository="file:/repository/location"
    artifactRepository="file:/repository/location"
    publishArtifacts="true"
    compress="true"
    flavor="tooling"
    executables="/delta/pack/location/eclipse/features/org.eclipse.equinox.executable_3.3.200.v20090507-7M-Fm-FI3UouOdgtbIvrva"
    productFile="/product/file/location/sample.product">
        <config ws="gtk" os="linux" arch="x86" />
  </p2.publish.product>

In addition to the default arguments, the product publishing task supports the following:

flavorSet the flavor for the p2 metadata, default is "tooling". Products should consider using a unique flavor if they have special requirements for bundle start levels.
productFileThe location of the .product file describing the product.
executablesThe location of the executables feature. This is the feature that is used for branding and publishing the executable
<config>Nested elements specifying configurations supported by this product. Config elements specify ws, os & arch:
<config ws="gtk" os="linux" arch="x86" />
<advice>Nested elements specifying specifying additional advice to use when creating the product. Currently the accepted kinds of advice are "featureVersions" and "pluginVersions".
<advice kind="featureVersions" file="finalFeaturesVersions.properties" />
<advice kind="pluginVersions" file="finalPluginsVersions.properties" />

PDE/Build will generate these version properties files when the builder sets the property <a href="pde_version_qualifiers.htm#final_versions">generateVersionsLists"</a>.

PDE Build

TODO: Add information about how to publish repositories using PDE Build. There is also some information about the ANT tasks PDE build provides at: PDE Ant Tasks

Extensible API

Getting Involved

There are a number of ways to get involved with the development of The Publisher. In particular:

  • Experiment with and give feedback on the publisher's provisional API
  • Ensure the publisher Java Docs are accurate (and provide feedback / patches where needed)
  • Experiment with the publisher's ANT tasks and headless applications
  • Review the list of outstanding publisher bugs Open Publisher Bugs

The publisher developer discusses take place on the p2-dev list

Back to the top