Blueprint Developer Manual / Version 2304
Table Of ContentsA plugin is a (zipped) folder with the following structure:
- classes/
The classes of your plugin
- lib/
Third-party dependencies (JAR files) used by your plugin
- plugin.properties
File for plugin configuration and metadata
The plugin.properties
file provides metadata of your plugin. Most importantly, the
properties give your plugin
an identifier and configure a Spring configuration class that will be registered with the
application context. These are the supported properties:
- plugin.id
The ID of the plugin, must be unique, for example,
MyPlugin
(required)- plugin.version
The version of the plugin following the Semantic Versioning Specification, for example,
1.2.3
or1.0.0-SNAPSHOT
(required)- plugin.configuration-class
The Spring Configuration class, for example,
com.acme.myplugin.MyPluginConfiguration
(optional; required for Java extensions but not needed for plugins that only provide resources)- plugin.provider
The provider/author of the plugin, for example,
ACME
(optional)- plugin.dependencies
Comma-separated list of plugin IDs, for example,
some-plugin,some-other-plugin
. See Section, “Plugin Dependencies” for details. (optional)- plugin.add-on-for
The plugin ID of the plugin that this plugin is an add-on for, for example,
some-plugin
(optional)
Maven Plugin
To create a plugin with Maven, you can use the coremedia-plugin-maven-plugin
.
To this end, the packaging type of the pom must be set to coremedia-plugin
, and the
coremedia-plugin-maven-plugin
has to be added with extensions
set to true
.
The plugin will then create a plugin-zip during the package phase.
It is possible to provide a custom plugin.properties
file
or to generate one using the configuration from the pom.
Example
@Import("SomePluginBeansConfig.class") @Configuration(proxyBeanMethods = false) public class MyPluginConfiguration { @Bean public MyExtension myExtension(SomeBean someBean) { return new MyExtension(someBean); } }
Example 4.5. com.acme.myplugin.MyPluginConfiguration
public class MyExtension implements SomeCoremediaExtensionPoint { public MyExtension(SomeBean someBean) { ... } ... }
Example 4.6. com.acme.myplugin.MyExtension
<project> <groupId>com.acme.myplugin</groupId> <artifactId>MyPlugin</artifactId> <version>1.2.4-SNAPSHOT</version> <packaging>coremedia-plugin</packaging> <build> <plugins> <plugin> <groupId>com.coremedia.maven</groupId> <artifactId>coremedia-plugins-maven-plugin</artifactId> <version>1.1.1</version> <extensions>true</extensions> <configuration> <pluginId>${project.artifactId}</pluginId> <pluginVersion>${project.version}</pluginVersion> <pluginConfigurationClass>com.acme.myplugin.MyPluginConfiguration</pluginConfigurationClass> <pluginProvider>ACME</pluginProvider> </configuration> </plugin> </plugins> </build> </project>
Example 4.7. pom.xml