Plugin descriptor
Every attribute of the generated plugin.xml.
A plugin descriptor, plugin.xml, declares a plugin's metadata and the libraries it loads. Dassault
documents the format in
Plugin descriptor.
Forge writes this file from the resource.* and plugin.* properties and from the jars
assemblePlugin collected, so a project edits properties rather than XML.
Example
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plugin class="com.lumon.macrodatarefinement.Main" class-lookup="GlobalFirst" id="com.lumon.macrodata-refinement" internalVersion="8009027" name="Macrodata Refinement" ownClassloader="false" provider-name="Mark S" version="8.9.27">
<requires>
<api version="1.2"/>
<required-plugin id="com.nomagic.magicdraw.plugins.impl.sysml" internalVersion="202400000" name="SysML" version="2024x Refresh2"/>
</requires>
<runtime>
<library name="macrodata-refinement-8.9.27-2024x-refresh2.jar"/>
<library name="libs/jackson-annotations-2.15.2.jar"/>
<library name="libs/jackson-core-2.15.2.jar"/>
<library name="libs/jackson-databind-2.15.2.jar"/>
</runtime>
</plugin>Attributes
The Rule column below states the XML schema's own contract for each attribute — what Dassault's
plugin manager accepts when it reads plugin.xml directly. That is a different contract from the
Forge property that fills each attribute: class-lookup and ownClassloader carry a schema default,
but the plugin.classLookup and plugin.ownClassloader properties that supply them do not carry a
matching one and are mandatory whenever resource.type reads Plugin or Plugin (commercial). See
Plugin metadata for the property rule.
plugin
| Name | Description | Rule |
|---|---|---|
class | Fully qualified name of the class the plugin manager loads and initializes, stored in the plugin runtime library and derived from com.nomagic.magicdraw.plugins | validatePluginClass fails the build unless the class extends com.nomagic.magicdraw.plugins.Plugin, is concrete and has a public no-argument constructor |
class-lookup | Priority of the parent class loader when the plugin uses ownClassloader. LocalFirst loads classes from the plugin's own loader even when the tool core also carries them, which is what lets a plugin use its own version of a shared library | Optional in the XML schema; LocalFirst or GlobalFirst (default). The plugin.classLookup property that supplies it carries no default: see Plugin metadata |
id | Unique plugin identifier, used by the plugin manager and by other plugins declaring a requirement | |
internalVersion | Plugin internal version, used when checking dependencies | Positive integer |
name | Plugin name | |
ownClassloader | Whether the plugin loads in a class loader of its own rather than the shared one. Use it when plugin library versions conflict | Optional in the XML schema; boolean, default false. The plugin.ownClassloader property that supplies it carries no default: see Plugin metadata |
provider-name | Provider name, company or author | |
version | Plugin version, used to check dependencies when internalVersion is absent | Prefer semantic versioning; free text is accepted |
requires
| Name | Description | Rule |
|---|---|---|
api version | Modeling-tool API version required | For example, 1.2 |
required-plugin
| Name | Description | Rule |
|---|---|---|
id | Identifier of the required plugin | Must match another plugin's id |
internalVersion | Internal version of the required plugin | Positive integer |
name | Name of the required plugin | Must match another plugin's name |
version | Version of the required plugin | For example, 2024x Refresh2 |
Forge fills these nodes from the catiaMagic dependencies a project declares. See
Declare dependencies.
runtime
One <library> element per jar the plugin needs at runtime.
| Name | Description | Rule |
|---|---|---|
library name | Path of the library, relative to the descriptor directory, using forward slashes | For example, pluginlib.jar, libs/otherlib.jar |