Eclipse Feature Project. This tutorial describes the purpose and usage of Eclipse feature projects and Fragments.
Using the Eclipse wizards you can create feature projects, similarly on how you create plug-in projects. An Eclipse feature project contains features.
A feature describes a list of plug-ins and other features which can be seen as a logical unit, i.e., a set of related components. It also has a name, a version number and in most cases a license information assigned to it.
A feature is described via a feature.xml file. The following listing shows an example of such a file.
<?xml version="1.0" encoding="UTF-8"?> <feature id="com.vogella.eclipse.featuretest.feature" label="Feature" version="1.0.0.qualifier" provider-name="vogella GmbH"> <description url="http://www.example.com/description"> [Enter Feature Description here.] </description> <copyright url="http://www.example.com/copyright"> [Enter Copyright Description here.] </copyright> <license url="http://www.example.com/license"> [Enter License Description here.] </license> <plugin id="com.vogella.eclipse.featuretest.feature" download-size="0" install-size="0" version="0.0.0" unpack="false"/> </feature>
The grouping of plug-ins into logical units makes it easier to handle a set of plug-ins. Instead of adding many individual plug-ins to your product configuration file, you can group them using features. That increases the visibility of your application structure.
Features can be consumed by the Eclipse update manager, the build process and optionally for the definition of Eclipse products. Features can also be used as basis to define a launch configuration.
Eclipse provides several predefined features, e.g.
for Eclipse RCP applications.
A product can either be based on plug-ins or on features. This setting is done on the Overview tab of the product configuration file.
On the Contents tab in the product editor you enter the plug-ins or features your products consists of.
A product does not perform automatic dependency resolution. If you add a feature to your product and want to add its dependencies, press the Add Required button.
You can create a new feature project via the following menu path:.
If you open the feature.xml file you can change the feature properties via a special editor.
The Information tab allows you to enter a description and copyright related information for this feature.
The Included Plug-ins tab allows you to change the included plug-ins in the feature. If you want to add a plug-in to a feature, use this tab. A frequent error of new Eclipse developers is to add it to the Dependencies tab.
The Included Features tab allows you to include other features into this feature. Via the Dependencies tab you can define other features which must be present to use this feature.
The Build tab is used for the build process and should include the feature.xml file. The last two tabs give access to the configuration files in text format.
|TRAINING||SERVICE & SUPPORT|
The vogella company provides comprehensive training and education services from experts in the areas of Eclipse RCP, Android, Git, Java, Gradle and Spring. We offer both public and inhouse training. Whichever course you decide to take, you are guaranteed to experience what many before you refer to as “The best IT class I have ever attended”.
The vogella company offers expert consulting services, development support and coaching. Our customers range from Fortune 100 corporations to individual developers.
Copyright © 2012-2017 vogella GmbH. Free use of the software examples is granted under the terms of the EPL License. This tutorial is published under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Germany license.