# Using Version Qualifiers

Eclipse bundles and features have version numbers of the form major.minor.micro.qualifier. The qualifier segment of the version is often used to indicated a specific build. If you set your feature or plug-in version qualifier to "`qualifier`" (i.e. a version of `1.0.0.qualifier`), then PDE build will automatically replace the word "qualifier" with a generated qualifier.

## Controlling the Generated Qualifier

A feature or plug-in can control its qualifier by setting the property "`qualifier`" in its build.properties file. There are are a couple of different cases for the value of this property:

`qualifier = none` | Sets the qualifier to be empty. (i.e. "1.2.3.qualifier" becomes "1.2.3")
`qualifier = context` | Sets the qualifier to be the context qualifier. See below for the value of the context qualifier.
not set | If the "`qualifier`" property is not set, this is equivalent to setting `qualifier = context`.
`qualifier = v12345` | Any other value sets the qualifier to be that value.

### The Context Qualifier

The value of the generated context qualifier is determined by the first of the following items that apply:

1. If the property `forceContextQualifier` is set in your builder's configuration build.properties file, then the value of this property is used as the qualifier. This property can also be set on the command line with -D when invoking ant.
   - When exporting from the UI, `forceContextQualifier` is set according to the "Qualifier replacement" value on the options tab of the "Deployable plug-ins and fragments" export wizard.
2. If you are using map files to fetch your bundles from a repository, then the tag that was used to fetch the bundle will be used as the qualifier.
3. If neither forceContextQualifier nor map files are used, then the qualifier will be a time stamp in the form YYYYMMDDHHMM (i.e. 200605121600)

## Feature Version Suffixes

You can turn on the generation of qualifier suffixes for features by setting the property `generateFeatureVersionSuffix=true` in the build configuration build.properties file.
The idea of a version is that it should increment each time something changes, the version qualifier increments and captures changes from build to build. Features rarely change, however, they do contain plug-ins which may change often. When version suffixes are turned on, a feature version will have the form major.minor.micro.qualifier-suffix. The suffix is in effect the sum of the version qualifiers of all the features and plug-ins included by the feature. This means that when one of the included plug-ins increments its version, then the version of the feature will automatically increment as well. This is particularly useful when the feature is deployed via an update site.

## Final Versions

Occasionally there may be custom build steps that may require the actual final version used in the build. When the property `generateVersionsLists` is set, PDE Build will generate properties files containing the versions of the features and plug-ins that were built. These properties files can be loaded using the ant property task.

The files are named: finalPluginsVersions.properties, finalPluginsVersions.<config>.properties, finalFeaturesVersions.properties, and finalFeaturesVersions.<config>.properties. finalPluginsVersions.properties and finalFeaturesVersions.properties contain the versions for all of the plug-ins and features that were built. The <config> properties files contain the versions of plug-ins and features for specific build configurations.

The properties in these files have the form:

        <bundleSymbolicName> = <version>
        <bundleSymbolicName>_<first 3 segments of version> = <version>

If more than one versions of a plug-in or feature exists, then `<bundleSymbolicName>=<version>` refers to the plug-in or feature with the highest version.

Example:

        org.eclipse.pde.build = 3.3.0.v20070524
        org.eclipse.pde.build_3.3.0=3.3.0.v20070524
        org.eclipse.pde.build_3.2.1=3.2.1.r321_v20060823