A feature project is used in Eclipse to create, test, and export features. Features are used to group many plug-ins together into a coherent unit. For example, the JDT feature consists of 26 separate plug-ins. Features are also used in the construction of update sites, which are covered later in this chapter.
com.packtpub.e4.feature
and this will be used as the default name for the Feature ID. As with plug-ins, they are named in reverse domain name format, though typically they end with feature
to distinguish them from the plug-in that they represent. The version number defaults to 1.0.0.qualifier
. The feature name is used as the text name which is shown to the user when it's installed, and will default to the last segment of the the project name. com.packtpub.e4.clock.ui
from the list.feature.xml
file to open it in an editor, go to the Plug-ins tab, and verify that the clock plug-in has been added as part of the feature.A feature project called com.packtpub.e4.feature
was created with a feature.xml
file. The information specified in the dialog can be seen in this file, and changed later if necessary.
<feature id="com.packtpub.e4.feature" label="Feature" version="1.0.0.qualifier" provider-name="PACKTPUB"> <plugin id="com.packtpub.e4.clock.ui" download-size="0" install-size="0" version="0.0.0" unpack="false"/> </feature>
The feature ID must be globally unique, as this is the identifier Eclipse and P2 will use for installation. The feature version follows the same format as plug-in versions; major.minor.micro.qualifier
, where:
The qualifier can be any textual value. The special keyword qualifier
is used by Eclipse to substitute the build number, which if not specified is formed from the date and timestamp.
The plug-in listed here is the one chosen from the wizard. It will default to 0.0.0
—but when the feature is published, it will choose the highest version available and then replace the version string for the plug-in.
There may also be other elements in the feature.xml
file, such as license
, description
, and copyright
. These are optional, but if present, will be displayed in the update dialog when installing.