Once a feature has been created and has one or more plug-ins added, they can be exported from the workbench. An exported feature can be installed into other Eclipse instances, as the next section will demonstrate. Note that exporting a feature also builds and exports all the associated plug-ins as well.
com.packtpub.e4.feature
and give a suitable directory location.artifacts.jar
content.jar
features/com.packtpub.e4.feature_1.0.0.201305070958.jar
plugins/com.packtpub.e4.clock.ui_1.0.0.201305070958.jar
The File | Export | Deployable features did a number of steps under the covers. First, it compiled the referenced plug-ins into their own JARs. It then zipped up the contents of the feature project, and finally moved them both into the directory under the features
and plugins
subdirectories.
When a feature is exported, the associated plug-ins are built, and so problems in exporting are often caused by problems compiling the plug-ins.
To debug problems with plug-in compilation, check the build.properties
file. This is used to control the ant-based build that PDE uses under the covers. Sometimes, PDE will flag warnings or errors in this file, especially if the source or compilation folders are moved or renamed after creating a project.
A build.properties
file looks similar to the following:
source.. = src/ output.. = bin/ bin.includes = plugin.xml, META-INF/, ., icons/
If there are any problems, verify that these correspond to paths in the plug-in's directory. The source..
is actually a reference to the current directory. If there are multiple JARs being created, then this will read source.ajar
and source.anotherjar
. The source directive is used if plug-ins have source exported; classes and other compiled output comes from the output
property. If the output directory is renamed (for example target/classes
) then ensure the output..
property is updated in the build.properties
file.
If there are non-Java assets that need to be exported, they must be explicitly listed in this file. If a directory (such as icons/
) is included, then this path will be re-created in the plug-in's JAR structure when it is created. Individual assets underneath the icons/
folder do not need to be explicitly listed.