Plugin Migration

Starting with Gentics Mesh 0.37.0 a new plugin API was introduced. Older plugins need to migrate to this API in order to be deployable. This document contains a collection of the most important changes to help migrate older plugins to the new system.

New plugin setup

The AbstractPluginVerticle class has been replaced by AbstractPlugin. In order to create a REST API plugin you now also need to implement the RestPlugin interface for your plugin.

Additionally it is required to specify the following constructor in your plugin:

public YourPlugin(PluginWrapper wrapper, PluginEnvironment env) {
    super(wrapper, env);
}

New manifest handling

The manifest of the plugin will now be added in the MANIFEST.MF file of the plugin jar. You can read more about this new manifest in the Plugin development guide.

The files com.gentics.mesh.plugin.plugin-service.json and mesh-plugin.json are no longer needed and can be deleted.

New dependencies

You can now use a BOM file to manage the versions of Gentics Mesh Artifacts.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.gentics.mesh</groupId>
            <artifactId>mesh-plugin-bom</artifactId>
            <version>${mesh.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Using the BOM will allow you to add Gentics Mesh dependencies without the need to specify the versions.

<dependency>
    <groupId>com.gentics.mesh</groupId>
    <artifactId>mesh-plugin-dep</artifactId>
    <scope>provided</scope>
</dependency>

More about the needed dependencies can be found in the Plugin development guide.

Life cycle changes

It is no longer possible to override the start and stop methods. Please move your initialisation and shutdown logic to initialize() and shutdown().

New changes

Some methods have been updated:

  • registerEndpoints(Router globalRouter, Router projectRouter)createGlobalRouter() & createProjectRouter()

  • getApiName()restApiName()

  • getName()id()

  • getVertx()vertx()

  • deploymentId()id()