Ant Tasks for Publishing p2 Metadata

p2 ships with two publisher ant tasks. The ant tasks are contained in org.eclipse.equinox.p2.publisher. This bundles is part of the Eclipse SDK.

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.


p2.publish.featuresAndBundles

This task will publish metadata for pre-existing binary features and plug-ins.

This task supports the following attributes and elements:

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.

p2.publish.product

Publish a .product file. This task assumes everything included in the product already exists in the repository. (That is, all features and bundles have been previously published.)

This task supports the following attributes:

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 executables.
<config>Nested elements specifying configurations supported by this product. Config elements specify ws, os and arch:
<config ws="gtk" os="linux" arch="x86"/>
Use <config ws="ANY" os="ANY" arch="ANY"/> if the product can support any platform.
<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 generateVersionsLists".

In addition to the publisher tasks, metadata can be generated as part of PDE Build.