Eclipse Platform
Update Packaging Conventions
Revision Date: 12/09/2002 8:56AM - Version: 2.0.15
Change History:
- 2.0.16
- added <site><feature> os,arch,nl,ws support
"*"
- 2.0.15
- added <site><feature> os,arch,nl,ws,patch tag
- 2.0.14
- added <site><feature> label tag
- 2.0.13
- added <includes name,optional,match,search_location
>
- added <import feature,patch>
- 2.0.12
- 2.0.11
- <feature> <license> is required
- 2.0.10
- <feature colocation-affinity="">
- 2.0.9
- <site> <feature> changes - additional
markup to optionally expose feature identification information to speed
up searches
- removed obsolete text
- web-triggered update not in 2.0
- no assist in 2.0 for license/ "key file" handling
(individual application/ plugin responsibility)
- 2.0.8
- 2.0.7
- support explicit xml markup for primary features
- 2.0.6
- install handler markup changes
- 2.0.5
- updates to security section
- 2.0.4
- general text cleanup
- <feature><group> support removed (will
not be in Eclipse 2.0)
- arch= support added to <feature> and <feature><plugin>
- os=/ arch=/ ws=/ nl= added to <fetaure><data>
- <site url=""> new semantics
- corrected errors in native installer link support
- defined callback query strings for browser-triggered
processing
Table of Contents
Introduction
Changes
from 1.0
Concepts
Framework
Packaging Conventions
Feature
Archive
Plug-In
Archive
Packaging
NL
Translated Feature Information
Translated Plug-In Information
Packaging Target-Specific Support
Packaging Attribution Information
Packaging Non-Plug-In Files
Custom Install Handling
Security Considerations
Update Server
Site Map
Default
Site Layout
Controlling
Access
Eclipse Install
Default Install Layout
"Unmanaged"
Plug-Ins
Using Native Platform Installers
Introduction
This document outlines the support for managing the delivery of function
within the Eclipse platform. Also refer to the " Eclipse.org Update
Manager Agreement " for additional legal information governing the use
of the Eclipse update manager function.
Changes from R1.0
This section describes the major design changes from the R1.0 Installation
and Update support and supplies rationale for each design change.
- extendable framework
In R2.0 Eclipse defines an extendable framework for installation and update,
allowing the support for alternate packaging and site management schemes.
R2.0 supplies a default concrete implementation of this framework. -
feature support
In R2.0 the concept of a component and configuration is
merged into feature. Features define the packaging structure for
a group of related plug-ins, plug-in fragments, and optionally non-plug-in
files. Features are treated purely as an installation and packaging construct.
They do not play a role during Eclipse plug-in execution. Features do not
nest. They are simply an inclusive "manifest" of the plug-ins, fragments
and other files that make up that feature. If features are logically made
up of plug-ins from "sub-features", the top-level feature "manifest" must
be fully resolved at packaging time. - default feature archive format
R1.0 components were packaged as a single Java .jar containing the component
manifest as well as the actual plug-in files. The problem with this approach
is lack of granularity at download time. In R2.0, the feature archive consists
of multiple separate .jars - one .jar per plug-in and fragment, plus one
.jar for the actual feature information. The Installation and Update support
selectively downloads only those jars required for the installation. -
site map
Default Eclipse update server must contain a site map file (site.xml).
This is an evolution of the R1.0 install.index support. The rationale for
using a structured site defined by the map rather than a "free form" web
site, is the ability to present a consistent installation experience for
the user. Also, this provides the necessary structure for discovery of available
updates. Additional support for "free form" browsing may be considered in
future work. - using native install/ uninstall
The primary mechanism for installing and updating Eclipse features is
the built-in installation and update support. Some products may instead
choose to use native installer technology (eg. MSI, RPM, etc) to deliver
Eclipse features. However, native installers do not implement the required
support for understanding the Eclipse installation structure. In particular,
the native uninstallers will, by default, remove plug-in files that were
installed using the native installer without regard to these plug-ins being
needed by other features. As a result, features installed using native installers
must be written into private product-specific installation location and not
the shared Eclipse installation location. The shared Eclipse is made aware
of the produce-specific location via an installed "link file". - custom
install handling
In many cases the standard installation handling supplied by Eclipse is
not be sufficient to handle various custom requirements. To accommodate
this, R2.0 Eclipse supports custom install handlers packaged as part of
the feature and executed during the feature installation. - path naming
conventions
R1.0 mandated the use of the various identifiers and versions inside the
packaged archives (eg. directory path names for plug-ins). This approach
has proven to be ackward and error prone. In 2.0, the packaging requirements
no longer mandate that path names of packaged files precisely reflect the
contained identifiers and versions. The properly identified install subdirectories
are created by the Eclipse support during the installation and update process
based on the archive content (rather than explicit jar path structure set
up at packaging time)
Concepts
Plug-in
Eclipse developers build plug-ins. Plug-ins are the base units of execution
recognized by the Eclipse runtime environment. In general, plug-ins are
not exposed to users that select function during installation or update.
The reason is that plug-in boundaries are established by developers for development
reasons (like function reuse) and present the wrong level of granularity
in terms of what the user sees as the unit of function.
While plug-ins are being developed (ie. are frequently being changed),
their internal file structure will reflect what is convenient to the developer.
This will generally depend on the particular development tool being used.
Typically, however, the developer will likely setup the plug-in to execute
from a directory tree containing exposed .class files, rather than executing
from a .jar (requires an extra step to create the .jar and we all know
developers hate extra steps). Also, at this stage the developer does not
pay particular attention to plug-in versioning information, because the
plug-in is continually changing.
However, when the plug-in is ready to be packaged, it needs to be converted
to a form suitable for packaging and installation. Typically it means creation
of the runtime .jar(s) and removing any development-time files (source,
exposed .class files, etc). It also means updating the plugin.xml manifest
with the formal plug-in version and reflecting the version in the plug-in
directory name (see "Concurrent Plug-In Version Support" for details).
Plug-in Fragment
Plug-in Fragments (or simply Fragments) allow independent packaging of
certain aspects of the base plug-in. This includes (but may not be limited
to) translated resources for the plug-in, OS-specific or windowing-system-specific
code. At runtime, fragments are logically merged into the base plug-in. From
a packaging point of view, the install and update support does not really
differentiate between plug-ins and their related fragments.
Feature
A feature is an installation packaging mechanism used to define a group
of versioned plug-ins and/or plug-in fragments plus non-plug-in files that
is used to deliver some user function. A feature can also include other
features. Features are exposed to users as part of the packaging and installation
process, because they represent a unit of function selection. Features also
represent a unit of installation. Features carry a version identifier.
Features are packaged as a feature archive, referencing the required plug-ins,
plug-in fragments and optional non-plug-in files. The feature archives are
placed on an update server for download and installation by the Eclipse update
manager, or they can be used as the input into a formal packaging process
using one of the "traditional" installer technologies. The format of the
feature archive is described later.
Framework
The 2.0 installation and update support is provided as a framework that
allows custom implementations to be supplied for its key elements. In particular,
the following can be supplied:
- concrete implementations of feature (IFeature interface) that can
be used to support alternate packaging schemes. New concrete feature types
are registere via the "org.eclipse.update.featureTypes" extension point.
- concrete implementations of site (ISite interface) that can be
used to support alternate site layout, or site behavior. New concrete site
types are registered via the "org.eclipse.update.siteTypes" extension point.
- each feature can specify a custom install handler as part of its
feature manifest. Install handlers (IInstallHandler interface) are dynamically
invoked as part of the installation process to handle non-plugin data, plus
perform other custom processing allowed by the framework.
Eclipse provides default implementations of feature and site. These are
described in the rest of this document.
| Note: The reminder of this document describes the default concrete
implementation of the framework delivered with Eclipse. It specifies the
structure of the default feature implementation, as well as the default
site implementation, plus the corresponding xml files (feature.xml and site.xml).
Providers of alternate concrete implementations can extend parts or
all of the default Eclipse implementation. This includes providing a mechanism
for dynamic computation of the site map (site.xml) |
Packaging Conventions
Default feature packages consist of several related files:
- exactly one jar containing the feature manifest and related files.
This one is refered to as the "feature archive"
- zero or more jars containing the feature plug-ins. These are refered
to as the "plug-in archives"
- zero or more non-plug-in files associated with the feature. They
are used by feature custom install handlers and contain data not interpreted
by Eclipse
Feature Archive
The feature packaging information is placed into a separate Java .jar.
Standard Java jar facilities are used for constructing feature archives.
Feature archives reference separately packaged plug-in archives (see next
section) and non-plug-in files.
Features are identified using a structured identifier based on the provider
internet domain name. For example, organization eclipse.org may produce
feature org.eclipse.javatooling. The character set used for feature identifiers
is as specified for plug-in identifiers (see reference information describing
the plug-in manifest).
The recommended convention for naming the feature archives is
<id>_<version>.jar
Where <id> is the feature identifier and <version>
is the full version identifier contained in the respective feature.xml.
Note that this is a recommended convention that minimizes chance of collisions,
but is not required by the Eclipse architecture. For example, the following
are valid feature archive names
org.eclipse.javatooling_1.0.3.jar
org.eclipse.pde_2.0.jar
my_feature.jar
Internally, each feature archive is packaged relative to its feature directory
(but not including the directory path element). The archive has the following
structure
feature.xml
feature<_locale>.properties (see "Translated Feature Information")
other feature files and subdirectories (TBD)
META-INF/
Java jar manifest and security files
The feature install.xml format is defined by the following dtd:
<?xml encoding="ISO-8859-1"?>
<!ELEMENT feature (install-handler?, description?, copyright?,
license?, url?, includes*, requires?, plugin*, data*)>
<!ATTLIST feature
id
CDATA #REQUIRED
version CDATA
#REQUIRED
label
CDATA #IMPLIED
provider-name CDATA #IMPLIED
image
CDATA #IMPLIED
os
CDATA #IMPLIED
arch
CDATA #IMPLIED
ws
CDATA #IMPLIED
nl
CDATA #IMPLIED
colocation-affinity
CDATA #IMPLIED
primary (true
| false) "false"
application CDATA #IMPLIED
>
<!ELEMENT install-handler EMPTY>
<!ATTLIST install-handler
library CDATA
#IMPLIED
handler CDATA
#IMPLIED
>
<!ELEMENT description (#PCDATA)>
<!ATTLIST description
url
CDATA #IMPLIED
>
<!ELEMENT copyright (#PCDATA)>
<!ATTLIST copyright
url
CDATA #IMPLIED
>
<!ELEMENT license (#PCDATA)>
<!ATTLIST license
url
CDATA #IMPLIED
>
<!ELEMENT url (update?, discovery*)>
<!ELEMENT update EMPTY>
<!ATTLIST update
url
CDATA #REQUIRED
label
CDATA #IMPLIED
>
<!ELEMENT discovery EMPTY>
<!ATTLIST discovery
url
CDATA #REQUIRED
label
CDATA #IMPLIED
>
<!ELEMENT includes EMPTY>
<!ATTLIST includes
id
CDATA #REQUIRED
version
CDATA #REQUIRED
name
CDATA #IMPLIED
optional
(true | false) "false"
match
(perfect | equivalent | compatible | greaterOrEqual)
"compatible"
search_location ( root | self | both) "root"
>
<!ELEMENT requires (import+)>
<!ELEMENT import EMPTY>
<!ATTLIST import
plugin
CDATA #IMPLIED
feature CDATA #IMPLIED
version CDATA
#IMPLIED
match
(perfect | equivalent | compatible | greaterOrEqual) "compatible"
patch
(true | false) "false"
>
<!ELEMENT plugin EMPTY>
<!ATTLIST plugin
id
CDATA #REQUIRED
version CDATA
#REQUIRED
fragment (true |
false) "false"
os
CDATA #IMPLIED
arch
CDATA #IMPLIED
ws
CDATA #IMPLIED
nl
CDATA #IMPLIED
download-size CDATA #IMPLIED
install-size CDATA #IMPLIED
>
<!ELEMENT data EMPTY>
<!ATTLIST data
id
CDATA #REQUIRED
os
CDATA #IMPLIED
arch
CDATA #IMPLIED
ws
CDATA #IMPLIED
nl
CDATA #IMPLIED
download-size CDATA #IMPLIED
install-size CDATA #IMPLIED
>
The element and attribute definitions are as follows:
- <feature> - defines the feature
- id - required feature identifier (eg. com.xyz.myfeature)
- version - required component version (eg. 1.0.3)
- label - optional displayable label (name). Intended to be translated.
- provider-name - optional display label identifying the organization
providing this component. Intended to be translated.
- image - optional image to use when displaying information about
the feature. Specified relative to the feature.xml.
- os - optional operating system specification. A comma-separated
list of os designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this feature should only be installed on one of the specified
os systems. If this attribute is not specified, the feature can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of feature regardless of this setting).
- arch - optional machine architecture specification. A comma-separated
list of architecture designators defined by Eclipse (see Javadoc for
org.eclipse.core.boot.BootLoader). Indicates this feature should only
be installed on one of the specified systems. If this attribute is not specified,
the feature can be installed on all systems (portable implementation). This
information is used as a hint by the installation and update support (user
can force installation of feature regardless of this setting).
- ws - optional windowing system specification. A comma-separated
list of ws designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this feature should only be installed on one of the specified
ws systems. If this attribute is not specified, the feature can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of feature regardless of this setting).
- nl - optional locale specification. A comma-separated list of locale
designators defined by Java. Indicates this feature should only be installed
on a system running with a compatible locale (using Java locale-matching
rules). If this attribute is not specified, the feature can be installed on
all systems (language-neutral implementation). This information is used as
a hint by the installation and update support (user can force installation
of feature regardless of this setting).
- colocation-affinity - optional reference to another feature identifier
used to select the default installation location for this feature. When
this feature is being installed as a new feature (no other versions of it
are installed), an attempt is made to install this feature in the same installation
location as the referenced feature.
- primary - optional indication specifying whether this feature can
be used as a primary feature . Default if
false (not a primary feature).
- application - optional identifier of the Eclipse application that
is to be used during startup when the declaring feature is the primary feature . The application identifier
must represent a valid application registered in the org.eclipse.core.runtime.applications
extension point. Default is org.eclipse.ui.workbench.
- <install-handler>
- library - optional .jar library containing the install handler classes.
If specified, the referenced .jar must be contained in the feature archive.
It is specified as a path within the feature archive, relative to the feature.xml
entry. If not specified, the feature archive itself is used to load the
install handler classes. This attribute is only interpreted if class
attribute is also specified
- handler - optional identifier of the install handler. The value
is interpreted depending on the value of the library attribute. If
library is specified, the value is interpreted as a fully
qualified name of a class contained in the specified library. If
library is not specified, the value is is interpreted as an
extension identifier of an extension registered in the org.eclipse.update.installHandlers
extension point. In either case, the resulting class must implement the
IInstallHandler interface. The class is dynamically loaded
and called at specific points during feature processing. The handler has
visibility to the API classes from the update plug-in, and Eclipse plug-ins
required by the update plugin.
- <description> - brief component description as simple text.
Intended to be translated.
- url - optional URL for the full description as HTML. The URL can
be specified as absolute of relative. If relative, it is assumed to be relative
to (and packaged in) the feature archive. Note, that for NL handling the
URL value should be separated to allow alternate URLs to be specified for
each national language.
- <copyright> - feature copyright as simple text. Intended
to be translated.
- url - optional URL for the full description as HTML. The URL can
be specified as absolute of relative. If relative, it is assumed to be relative
to (and packaged in) the feature archive. Note, that for NL handling the
URL value should be separated to allow alternate URLs to be specified for
each national language.
- <license> - feature "click-through" license as simple text.
Intended to be translated. It is displayed in a standard dialog with [Accept]
[Reject] actions during the download/ installation process. Note, that click-through
license must be specified for any feature that will be selected for installation
or update using the Eclipse update manager. When using nested features,
only the nesting parent (ie. the feature selected for installation or update)
must have click-through license text defined. The license text is required
even if the optional url attribute is specified.
- url - optional URL for the full description as HTML. The URL can
be specified as absolute of relative. If relative, it is assumed to be relative
to (and packaged in) the feature archive. Note, that for NL handling the
URL value should be separated to allow alternate URLs to be specified for
each national language. Note, that the "content" of this URL is not
what is presented as the click-through license during installation processing.
The click-through license is the actual value of the <license>
element (eg. <license>click through text</license>)
- <url> - optional URL specifying site(s) contain feature updates,
or new features
- <update> - URL to go to for updates to this feature
- url - actual URL
- label - displayable label (name) for the referenced site
- <discovery> - URL to go to for new features. In general,
a provider can use this element to reference its own site(s), or site(s)
of partners that offer complementary features. Eclipse uses this element
simply as a way to distribute new site URLs to the clients
- url - actual URL
- label - displayable label (name) for the referenced site
- <includes> - optional reference to a nested feature that
is considered to be part of this feature. Nested features must be located
on the same update site as this feature
- id - required nested feature identifier
- version - required nested feature version
- name- optional displayable label (name). Intended to be translated.
- optional - optional specification indicating if this included
feature can be optionally installed. Default is "false"
- match - optional rule that will be applied when resolving
the feature reference. A perfect match (the default that matches
the 2.0.1 behavior) requires that the feature has exactly the version specified
by the version attribute. Other choices progressively relax the rule (
equivalent allows only service part of the version to be more recent,
compatible also allows minor part to be included in the
consideration, while greaterOrEqual simply allows any version
that is more recent or identical to the one specified).
- search_location - optional. Indicates whether the "New Updates"
action should search the update location determined by the nesting root feature
(root, is the default), or the location defined by the nested feature
(self), or search both (both) in that order (root first,
self if nothing is found).
- <requires> - optional feature dependency information. Is
expressed in terms of plug-in dependencies. If specified, is enforced by
the installation and update support at the time of installation
- <import> - dependency entry. Specification and processing
is a subset of the <import> specification in plugin.xml
- plugin - identifier of dependent plug-in.
- feature - identifier of dependent feature. If plugin and feature
are specified, plugin takes precedence upon feature. Feature or plugin must
be specified.
- version - optional plug-in/feature version specification
- patch - optional specification indicating if this feature is
a patch of the dependant feature. Default is "false". If patch is true, version
must be specified. If patch is true, only feature must be specified. If
patch is true, and match is specified, it must be 'perfect'.
- match - optional matching rule. Valid values and processing are
as follows:
- if version attribute is not specified, the match attribute (if specified)
is ignored.
- if version is specified, match defaults to compatible.
- if patch is true, and match is not specified, match defaults
to perfect.
- perfect - dependent plug-in version must match exactly
the specified version.
- equivalent - dependent plug-in version must be at
least at the version specified, or at a higher service level (major and minor
version levels must equal the specified version).
- compatible - dependent plug-in version must be at
least at the version specified, or at a higher service level or minor level
(major version level must equal the specified version).
- greaterOrEqual - dependent plug-in version must be
at least at the version specified, or at a higher service, minor or major
level.
- <plugin> - identifies referenced plug-in
- id - required plug-in identifier (from plugin.xml)
- version - required plug-in version (from plugin.xml)
- fragment - optional specification indicating if this entry is a
plug-in fragment. Default is "false"
- os - optional operating system specification. A comma-separated
list of os designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this entry should only be installed on one of the specified os
systems. If this attribute is not specified, the entry can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of entry regardless of this setting).
- arch - optional machine architecture specification. A comma-separated
list of architecture designators defined by Eclipse (see Javadoc for
org.eclipse.core.boot.BootLoader). Indicates this feature should only
be installed on one of the specified systems. If this attribute is not specified,
the feature can be installed on all systems (portable implementation). This
information is used as a hint by the installation and update support (user
can force installation of feature regardless of this setting).
- ws - optional windowing system specification. A comma-separated
list of ws designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this entry should only be installed on one of the specified ws
systems. If this attribute is not specified, the entry can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of entry regardless of this setting).
- nl - optional locale specification. A comma-separated list of locale
designators defined by Java. Indicates this entry should only be installed
on a system running with a compatible locale (using Java locale-matching
rules). If this attribute is not specified, the entry can be installed on
all systems (language-neutral implementation). This information is used as
a hint by the installation and update support (user can force installation
of entry regardless of this setting).
- download-size - optional hint supplied by the feature packager,
indicating the download size in KBytes of the referenced plug-in archive.
If not specified, the download size is not known (Implementation Note:
the implementation needs to distinguish between "not known" and 0 size)
- install-size - optional hint supplied by the feature packager,
indicating the install size in KBytes of the referenced plug-in archive.
If not specified, the install size is not known (Implementation Note:
the implementation needs to distinguish between "not known" and 0 size)
- <data> - identifies non-plugin data that is part of the feature
- id - required data identifier in the form of a relative path.
- os - optional operating system specification. A comma-separated
list of os designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this entry should only be installed on one of the specified os
systems. If this attribute is not specified, the entry can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of entry regardless of this setting).
- arch - optional machine architecture specification. A comma-separated
list of architecture designators defined by Eclipse (see Javadoc for
org.eclipse.core.boot.BootLoader). Indicates this feature should only
be installed on one of the specified systems. If this attribute is not specified,
the feature can be installed on all systems (portable implementation). This
information is used as a hint by the installation and update support (user
can force installation of feature regardless of this setting).
- ws - optional windowing system specification. A comma-separated
list of ws designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this entry should only be installed on one of the specified ws
systems. If this attribute is not specified, the entry can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of entry regardless of this setting).
- nl - optional locale specification. A comma-separated list of locale
designators defined by Java. Indicates this entry should only be installed
on a system running with a compatible locale (using Java locale-matching
rules). If this attribute is not specified, the entry can be installed on
all systems (language-neutral implementation). This information is used as
a hint by the installation and update support (user can force installation
of entry regardless of this setting).
- download-size - optional hint supplied by the feature packager,
indicating the download size in KBytes of the referenced data archive. If
not specified, the download size is not known (Implementation Note:
the implementation needs to distinguish between "not known" and 0 size)
- install-size - optional hint supplied by the feature packager,
indicating the install size in KBytes of the referenced data archive. If
not specified, the install size is not known (Implementation Note:
the implementation needs to distinguish between "not known" and 0 size)
When interacting with
the update site, the feature implementation maps the <plugin>
and <data> elements into path identifiers used by the site
to determine the actual files to download and install. The default feature
implementation supplied by Eclipse constructs the path identifiers as follows:
- <plugin> element results in a path entry in the form
"plugins/<pluginId>_<pluginVersion>.jar" (for example,
"plugins/org.eclipse.core.boot_1.0.3.jar")
- <data> element results in a path entry in the form
"features/<featureId>_<featureVersion>/<dataId>
" (for example, "features/com.xyz.tools_2.3.1/examples.zip")
Note, that in general the feature.xml manifest documents should
specify UTF-8 encoding. For example
<?xml version="1.0" encoding="UTF-8"?>
Translatable text contained in the feature.xml can be separated into feature<_locale>.properties
files using Java property bundle conventions. Note that the translated strings
are used at installation time (ie. do not employ the plug-in fragment runtime
mechanism).
Plug-In Archive
Plug-ins and plug-in fragments are individually packaged as separate
Java .jars. Standard Java jar facilities are used for constructing plug-in
archives. There is no distinction made between a plug-in archive containing
a plug-in and one containing a plug-in fragment.
The recommended convention for naming the plug-in archives is
<id>_<version>.jar
Where <id> is the plug-in or fragment identifier and
<version> is the full version identifier contained in the respective
plugin.xml or fragment.xml. Note that this is a recommended convention that
minimizes chance of collisions, but is not required by the Eclipse architecture.
For example, the following are valid plug-in archive names
org.eclipse.platform_1.0.3.jar
org.eclipse.ui.nl_2.0.jar
my_plugin.jar
Internally, each plug-in archive packages all the relevant plug-in or
fragment files relative to its plug-in or fragment directory (but not including
the directory path element). The archive has the following structure
plugin.xml *OR* fragment.xml
other plug-in or feature files and subdirectories
META-INF/
Java jar manifest and security files
Packaging NL
In Eclipse, translated plug-in information is packaged either together
with the base plug-in, or as a plug-in fragment. At runtime, Eclipse locates
the translations for the required locale. The use of fragments allows translations
to be added to the runtime without the need to repackage the base plug-ins.
This mechanism cannot be used for translating the actual packaging information
that is part of the installation xml files. Consequently the standard Java
translation conventions are used for the packaging information, and all
necessary translations must be available at the time the feature is packaged.
Translated Feature Information
Note: This section describes the conventions used for translating
the information contained within the feature manifest. It allows for the
update client to select the correctly localized strings from the update
server. This section specifically does not describe localization of individual
plug-ins.
Several of the attributes within the feature manifest are strings intended
for display through user interfaces. To facilitate translation, these attribute
values use the convention defined for translatable attributes of plugin.xml.
Strings beginning with % up to the first space are treated as resource
identifier keys (without the %) and looked up in a properties file. For
example
label="%cfg Tool Feature for Linux"
results in a resource lookup in the correct property file with key "cfg".
If no property files are supplied, or the key is not found the default
string value (following the %key) is used.
The property files are named as feature_<locale>.properties using
the Java resource bundle naming conventions. Within the feature archive
.jar they are placed in the same directory as their corresponding feature.xml
file.
Implementation Note: When accessing the resource bundles the Eclipse
installation and update code should create a class loader for accessing the
translated string. This way, the standard locale lookup algorithm implemented
by Java is automatically used.
ResourceBundle b;
ClassLoader l;
l = new URLClassLoader(new URL[] {<targetDirectoryURL>}, null);
b = ResourceBundle.getBundle("feature",Locale.getDefault(),l);
The resulting resource bundle can be used in IPluginDescriptor.getResourceString(String,ResourceBundle)
to actually return the correct translated string for the manifest attribute.
Translated Plug-In Information
No change from 1.0. Translated plug-in information should be packaged
as plug-in fragments.
Packaging Target-Specific
Support
No change from 1.0. Target-specific plug-in support (os, ws) should be
packaged as plug-in fragments.
Packaging Attribution
Information
This topic is covered in separate documents available on the eclipse.org
development resources page of the Update component.
Packaging Non-Plug-In Files
Arbitrary non-plug-in files can be included as part of the feature definition
using the <data> elements. Non-plug-in files typically also
requires specification of a custom install handler. In general, the Eclipse
support only downloads the referenced non-plug-in files and calls the custom
install handler to perform any actual installation steps.
Eclipse does not specify the format of the non-plug-in files.
Custom Install Handling
Custom install handlers are written as a Java class and are packaged
as part of the feature archive . The installer
must implement the IInstallHandler interface (in most cases will
extend the BaseInstallHandler abstract helper class which implements
IInstallHandler). When required, the install handler is dynamically
loaded by the installation and update code, and is called at specific points
during its processing. The install handler code has visibility to classes
from the installation and update support plug-in, and its prerequisite plug-ins.
Implementation Note: the detailed list of visible prerequisite
plug-ins is still evolving. It is expected to include org.eclipse.core.boot
and org.eclipse.core.runtime in all cases, plus org.eclipse.ui
and org.eclipse.swt when running with full workbench (ie. not "headless
mode"). Also, it would be useful to always expose org.eclipse.core.ant
so that build scripts can be used as part of the install handler implementation.
The IInstallHandler interface supports the following methods [Implementation
Note: the detailed definition of the IInstallHandler interface is still
evolving. The description below is not an API specification (simply a functional
description)]:
- install-initiated - the install handler is called after a feature
was selected for installation, but before any files were downloaded. It
is intended to implement any custom click-through or user registration
dialogs. The base implementation of this method supplied with the abstract
class BaseInstallHandler performs the default click-through
processing using the license text supplied as part of the feature manifest.
On return this method indicates success (installation continues) of failure
(installation is aborted).
- install-downloaded - the install handler is called after all the
required feature files were downloaded (feature, plugins, data) but before
the actual installation is performed. The install handler is expected to
perform verification of the non-plug-in data files (eg. security), or any
other pre-install processing. On return this method indicates success
(installation continues) or failure (installation is aborted).
- install-completion - the install handler is called after the feature
information and the plug-ins were installed. It is expected to complete the
installation of any non-plug-in data that was part of the feature. On return
this method indicates success (returns custom install log) or failure (installation
is aborted). On failure, the install handler is expected to perform any
required cleanup.
- uninstall-initiated - the install handler is called when a feature
is selected for removal, but before any of the standard uninstall processing
has taken place. It is passed the custom install log created by the install
handler install-completion step.
- uninstall-completion - the install handler is called on completion
of the standard uninstall steps. It is passed the custom install log created
by the install handler install-completion step.
Note, that as a general practice, install handlers should be provided
in their own jars (even though they could be just exposed in the feature
archive jar). The jar should be signed, and sealed.
Security Considerations
The general approach is to use base Java jar signing for the feature
and plug-in archive .jars.
Features are verified as follows:
- download and verify the feature archive (use base Java jar verification)
- for each plug-in archive
- verify the archive jar content (use base Java jar verification)
- verify plug-in id and version from <plugin> entry
in feature manifest matches downloaded plugin.xml
- for each non-plugin file
- call install handler to verify file
In general, when processing signed jars, the user will be prompted for
each unrecognized certificate. The response choices will include aborting
the installation (originator is not trusted), continuing the installation
(originator is trusted for this installation).
Update Server
The default Eclipse update server is any URL-accessible server. The default
implementation assumes a fixed-layout server. The content of the server
(in terms of available features and plug-ins) is described in a site map
file, site.xml. This file can be manually maintained, or can be dynamically
computed by the server.
Site Map
The update server URL can be specified as a full URL to the site map
file, or a URL of a directory path containing the site map file (similar
to index.html processing). The site map site.xml format is defined by the
following dtd:
<?xml encoding="ISO-8859-1"?>
<!ELEMENT site (description?, feature*, archive*, category-def*)>
<!ATTLIST site
type
CDATA #IMPLIED
url
CDATA #IMPLIED
>
<!ELEMENT description (#PCDATA)>
<!ATTLIST description
url
CDATA #IMPLIED
>
<!ELEMENT feature (category*)>
<!ATTLIST feature
type
CDATA #IMPLIED
id
CDATA #IMPLIED
version CDATA
#IMPLIED
url
CDATA #REQUIRED
label CDATA #IMPLIED
os
CDATA #IMPLIED
arch
CDATA #IMPLIED
ws
CDATA #IMPLIED
nl
CDATA #IMPLIED
patch
(true | false) "false"
>
<!ELEMENT archive EMPTY>
<!ATTLIST archive
path
CDATA #REQUIRED
url
CDATA #REQUIRED
>
<!ELEMENT category EMPTY>
<!ATTLIST category
name
CDATA #REQUIRED
>
<!ELEMENT category-def (description?)>
<!ATTLIST category-def
name
CDATA #REQUIRED
label
CDATA #REQUIRED
>
The element and attribute definitions are as follows:
- <site> - defines the site map
- type - optional site type specification. The value refers to a type
string registered via the install framework extension
point. If not specified, the type is assumed to be the default Eclipse site
type (as specified in this document).
- url - optional URL defining the update site baseline URL (used
to determine individual <feature> and <archive> location).
Can be relative or absolute. If relative, is relative to site.xml. If not
specified, the default is the URL location of the site.xml file.
- <description> - brief description as simple text. Intended
to be translated.
- url - optional URL for the full description as HTML. The URL can
be specified as absolute of relative. If relative, If relative, is relative
to site.xml.
Note, that for NL handling the URL value should be separated to allow
alternate URLs to be specified for each national language.
- <feature> - identifies referenced feature archive
- type - optional feature type specification. The value refers to
a type string registered via the install framework
extension point. If not specified, the type is assumed to be the default
feature type for the site. If the site type is the default Eclipse site type,
the default feature type is the packaged feature type (as specified in this
document).
- id - optional feature identifier. The information is used as a
performance optimization to speed up searches for features. Must match
the identifier specified in the feature.xml of the referenced archive (the
url attribute). If specified, the version attribute must also be specified.
- version - optional feature version. The information is used as
a performance optimization to speed up searches for features. Must match
the version specified in the feature.xml of the referenced archive (the
url attribute). If specified, the id attribute must also be specified.
- url - required URL reference to the feature archive. Can be relative
or absolute. If relative, it is relative to the location of the site.xml
file. Note: the default site implementation allows features to
be accessed without being explicitly declared using a <feature> entry.
By default, an undeclared features reference is interpreted as "features/<id>_<version>.jar"
- label - optional feature label. The value is used for optimization
when browsing the site from the update manager. Intended to be translated.
- os - optional operating system specification. A comma-separated
list of os designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this feature should only be installed on one of the specified
os systems. If this attribute is "*", the feature can be installed on
all systems (portable implementation). This information is used as a hint
by the installation and update support (user can force installation of feature
regardless of this setting).
- arch - optional machine architecture specification. A comma-separated
list of architecture designators defined by Eclipse (see Javadoc for
org.eclipse.core.boot.BootLoader). Indicates this feature should only
be installed on one of the specified systems. If this attribute is
"*", the feature can be installed on all systems (portable implementation).
This information is used as a hint by the installation and update support
(user can force installation of feature regardless of this setting).
- ws - optional windowing system specification. A comma-separated
list of ws designators defined by Eclipse (see Javadoc for org.eclipse.core.boot.BootLoader)
. Indicates this feature should only be installed on one of the specified
ws systems. If this attribute is "*", the feature can be installed
on all systems (portable implementation). This information is used as a
hint by the installation and update support (user can force installation
of feature regardless of this setting).
- nl - optional locale specification. A comma-separated list of locale
designators defined by Java. Indicates this feature should only be installed
on a system running with a compatible locale (using Java locale-matching
rules). If this attribute is "*", the feature can be installed on all
systems (language-neutral implementation). This information is used as a
hint by the installation and update support (user can force installation of
feature regardless of this setting).
- patch - optional specification indicating if this feature is a
patch. Default is "false".
- <archive> - identifies referenced "storage" archive (the
actual files referenced via the <plugin> or <data>
elements in the feature manifest). The site simply manages archives as a
path-to-URL map. The default Eclipse site implementation does not require
the <archive> section to be included in the site map (site.xml). Any
archive reference not explicitly defined as part of an <archive> section
is assumed to be mapped to a url in the form "<archivePath>" relative
to the location of the site.xml file.
- path - required archive path identifier. This is a string that is
determined by the feature
referencing this archive and is not otherwise interpreted by the site (other
than as a lookup token).
- url - required URL reference to the archive. Can be relative or
absolute. If relative, it is relative to the location of the site.xml file.
- <category-def> - an optional definition of a category that
can be used by installation and update support to hierarchicaly organize
features
- name - category name. Is specified as a path of name tokens separated
by /
- label - displayable label. Intended to be translated.
- <category> - actual category specification for a feature
entry
Note, that in general the feature.xml manifest documents should
specify UTF-8 encoding. For example
<?xml version="1.0" encoding="UTF-8"?>
Translatable text contained in the site.xml can be separated into site<_locale>.properties
files using Java property bundle conventions. Note that the translated
strings are used at installation time (ie. do not employ the plug-in fragment
runtime mechanism). The property bundles are located relative to the site.xml
location.
Default Site Layout
<site root>/
site.xml
features/
feature archives
(eg. org.eclipse.javatools_1.0.1.jar)
<featureId>_<featureVersion>/
(optional)
non-plug-in files for feature
plugins/
plug-in argives
(eg. org.eclipse.ui_1.0.3.jar)
Controlling Access
The default Eclipse site implementation provides support for http access
with basic user authentication (userid and password).
Custom access control mechanisms can be added to base Eclipse in one of
2 ways:
- by supplying server-side logic on the update server (eg. implementing
servlets that compute the site.xml map, and control access to individual
archives based on some user criteria)
- by supplying a custom concrete implementation of the site object
(installed on the client machine, update server specified <site
type=""> ). The custom concrete site implementation, together with
any server-side logic support the required control mechanisms.
Eclipse provides an example demonstrating an implementation of an access
mechanism based on feature key files.
Eclipse Install
Default Install Layout
<install root>/
install/
features/
<featureId>_<version>/
feature.xml
other feature files
META-INF/
META-INF-ECLIPSE/
plugins/
<pluginORfragmentId>_<version>/
plugin.xml or fragment.xml
other plugin or fragment files
META_INF/
Implementation Note: we will go back to the original design of
not splitting out fragments (ie. plugin and fragments go into the same install
location)
"Unmanaged" Plug-Ins
Eclipse supports a concept of "unmanaged" plug-ins. These are plug-ins
that were directly installed into the Eclipse file tree without being part
of a feature (eg. developer unzipping plug-in archive directly into the
Eclipse file tree).
Eclipse runtime recognizes these plugins during startup and loads the
plug-in information into the runtime registry following the standard plug-in
binding rules. The update support also recognizes the presence of this new
plug-in, but since this plug-in is not part of any feature it cannot be updated
using the update support (hence "unmanaged"). Unmanaged plug-in that become
referenced by a feature as a result of some future installation or update
action become "managed" (can be updated as part of the feature).
Unmanaged plug-ins are not displayed as part of the installation and update
UI.
Using Native Platform
Installers
The Eclipse installation contains plugins that can be shared across multiple
features. When installing and uninstalling features using the Eclipse installation
and update support, these relationship are correctly maintained. Only one
copy of any version of a plug-in is used.
However, when using native platform installers, performing native uninstall
creates problems because plug-ins would be removed without regard to any
sharing relationships. As a result, Eclipse does not allow plug-ins
to be installed using native installers into the shared installation tree.
Instead, native installers must establish their own installation root directory.
The subdirectory structure is the same as defined for base Eclipse. The
private root directory is logically linked into the shared Eclipse installation
via a link file installed by the native installer. The file path for the
link file is <configRoot>/links/. The <configRoot>
location is computed by Eclipse relative to the launch configuration file . By default,
this is the install/ directory in the shared Eclipse installation
tree.
The name of the link file is not specified by Eclipse. The name is determined
by the native installer. To minimize the potential for naming collisions,
it is recommended that the file name contain the identifier and version
of the feature being installed by the native installer. For example, <featureId>_<featureVersion>.properties
. The file content is in the form of a Java properties file, with the following
properties defined:
path=[r|rw] install-path[,[r|rw] install-path]*
The property path is a comma-separated list of optionally annotated
install paths. The property value install-path is a full file
path to the installation directory root, specified in local OS format. The
optional annotation r or rw indicates whether Eclipse
update support should allow the specified location to be used for updates.
Default is to allow updates (w).
Eclipse does not manage the linked directories in any way. It simply detects
their existence by the presence of the link files, and includes the linked
plug-ins during the platform startup. The native installer is responsible
for uninstalling the link when the corresponding directory is removed. Eclipse
runtime ignores any links that cannot be resolved.