A plugin descriptor is a file written in XML and named plugin.xml. Each descriptor contains properties of the one plugin. The descriptor file should contain the definitions of elements of the one plugin.
The plugin.xml file consists of the following elements:
The following tables describe them in more details.
plugin
Attribute | Description |
---|---|
id | A plugin ID should be unique. It is used to identify a plugin by a plugin's manager internals and by requirements of other plugins. For example, my.first.plugin.0. |
name | A plugin name. There is no strict rules applied to this attribute. For example, Example plugin. |
version | A plugin version. The version can be used to check other plugins dependencies, if internalVersion is not defined. |
internalVersion | A plugin internal version. It is used to check other plugins dependencies. |
provider-name | A plugin provider name, which is a company or an author name. For example: No Magic. |
class | A full qualified class name. The class must be derived from com.nomagic.magicdraw.plugins. A plugin and stored in plugin runtime library. This class will be loaded and initialized by the plugin's manager. For example, myplugin.MyPlugin. |
ownClassloader | Optional; the default value is false. |
class-lookup | Optional; possible values are LocalFirst, GlobalFirst, the default value is GlobalFirst. |
Nested elements
Element name | Description |
---|---|
requires | A modeling tool API version required by the plugin. Plugins and their versions required by the plugin. |
runtime | Runtime libraries needed by a plugin. |
requires
Nested elements
Element name | Description |
---|---|
api | A required modeling tool API version. |
required-plugin | Plugin(s) that are required to run the plugin. |
api
Attribute | Description |
---|---|
version | A required modeling tool API version. For example, 1.0. |
required-plugin
Attribute | Description |
---|---|
id | The ID of a required plugin. For example, my.first.plugin.0. |
name | A name of a required plugin. |
internalVersion | An internal version of a required plugin. If it is not defined, the "version" is used to check if the required plugin is suitable. |
version | A version of a required plugin. If it is not defined, any required plugin version is suitable. For example: 1.1. |
optional | The default value of this attribute is false. If value is false (or attribute is skipped), the plugin will be loaded only if the required plugin is loaded. If value is true, the plugin will be loaded if the required plugin is loaded or required plugin is not installed. |
runtime
Nested elements
Element name | Description |
---|---|
library | A runtime library for a running plugin. |
library
Attribute | Description |
---|---|
name | A name (path) of the required library. The path is relative to the plugin descriptor directory (slash should be used to separate files in path). For example, "pluginlib.jar", "lib/otherlib.jar". |