This library provides a common framework for extending the Morpheus Ops Orchestration Tool. This includes providing plugin extensions for adding various integrations such as Cloud Integrations, Service Level Integrations or Providers for things like DNS, IPAM, Config Management, UI Extensions, Etc.
The plugin architecture requires Morpheus 5 or later.
Ensure you are using a version of the plugin that is compatible with your version of Morpheus. See the releases tab for more info.
The plugin API is published to Maven Central, include it in your gradle project:
dependencies {
compileOnly 'com.morpheusdata:morpheus-plugin-api:1.1.1'
}Please refer to the official documentation for more up to date guides on how to create a plugin.
Maintainers can follow the release process to publish plugin core releases.
Create and implement the Plugin class.
Plugins are packaged by using the shadowJar gradle task. This task bundles all dependencies required for the plugin.
A jar manifest must also be created to tell the PluginManager which class to load for the plugin. For example:
build.gradle
jar {
manifest {
attributes(
'Plugin-Class': 'com.example.ClusterLifecyclePlugin',
'Plugin-Version': version,
'Morpheus-Code': 'morpheus-cluster-lifecycle'
)
}
}Required plugins are runtime relationships between installed Morpheus plugins. Declare them separately through the Morpheus Gradle plugin:
morpheusPlugin {
requiredPlugins {
plugin('morpheus-networking') {
minVersion = '2.4.0'
maxVersion = '3.0.0'
}
plugin('morpheus-storage') {
minVersion = '5.1.0'
}
}
}When requiredPlugins is configured, the Gradle plugin requires Plugin-Class, Plugin-Version, and Morpheus-Code in META-INF/MANIFEST.MF and writes the requirements as compact JSON in the Morpheus-Required-Plugins attribute:
Morpheus-Required-Plugins: [{"code":"morpheus-networking","minVersion":"2.4.0","maxVersion":"3.0.0"},{"code":"morpheus-storage","minVersion":"5.1.0"}]
Manifest writers may fold long attribute values across continuation lines; the manifest API reconstructs the complete JSON value when reading it. Required-plugin version bounds are optional and use dotted numeric versions, optionally followed by dot- or hyphen-separated qualifiers such as .dev or -SNAPSHOT. Qualifiers are preserved in metadata but ignored for compatibility: 1.2.0.dev, 1.2.0-SNAPSHOT, and 1.2.0 compare equally. Missing numeric components count as zero. The supported range is minVersion <= installedVersion < maxVersion, so an exclusive maximum of 2.0.0 also excludes 2.0.0-SNAPSHOT. Existing plugin.yml and META-INF/morpheus.properties identity descriptors remain supported, but required plugins are declared only through Morpheus-Required-Plugins in the JAR manifest.
At load time, Morpheus orders plugins so every required plugin is initialized before the plugins that require it. Plugins with missing or incompatible required plugins are not initialized, independent plugins can still load, and required-plugin cycles are reported as load errors.
Libraries your plugin requires, such as cloud SDKs, are scoped to the plugin classpath. The PluginManager creates a new classpath for each plugin loaded so classes in one plugin do not interfere with Morpheus or other loaded plugins.