description |
---|
Learn how to build and deploy your own plugins |
Gravitee API Management (APIM) plugins extend and customize component behavior to meet your strategic needs. Each APIM distribution includes a default set of plugins. You can also deploy additional Gravitee-maintained and third-party plugins from the plugin marketplace.
Plugins follow a common structure:
-----------------
.
├── pom.xml
├── README.md
└── src
├── assembly
│ └── <plugin>-assembly.xml
├── main
│ ├── java
│ │ └── <main java files>
│ └── resources
│ └── plugin.properties
└── test
└── java
└── <test java files>
-----------------
Below are the different key files:
File | Description |
---|---|
pom.xml | The main Maven POM file |
README.md | The main entry point for the plugin documentation |
<plugin>-assembly.xml | The common Maven assembly descriptor |
plugin.properties | The plugin descriptor file |
{% tabs %} {% tab title="pom.xml" %} Gravitee projects are Maven-managed. A plugin project is described via the Maven Project Object Model file. {% endtab %}
{% tab title="README.md" %}
Each plugin should by documented by a dedicated README.md
file that contains comprehensive information related to the use of your plugin.
{% endtab %}
{% tab title="-assembly.xml" %}
To integrate with the Gravitee ecosystem, a plugin needs to be deployed with a given file structure. The <plugin>-assembly.xml
file is the Maven Assembly descriptor used to build the distribution file, which has the following structure:
-----------------
.
├── <main Jar file>.jar
└── lib
-----------------
The different files/folders are described below:
File | Description |
---|---|
<main Jar file>.jar | The plugin’s main Jar file |
lib/ | A directory containing external libraries to correctly execute the .jar |
{% tabs %}
{% tab title=".jar" %}
The main .jar
file of each plugin contains information on the business behavior and the plugin descriptor file.
{% endtab %}
{% tab title="lib/" %} This directory contains all of the plugin's external dependencies (non-provided-scope Maven dependencies). {% endtab %} {% endtabs %} {% endtab %}
{% tab title="plugin.properties" %}
The plugin.properties
file is the plugin descriptor, which acts as an ID card and is read by APIM Gateway during the plugin loading process. The descriptor includes the following parameters:
Parameter | Description |
---|---|
id | The plugin identifier |
name | The plugin name |
version | The plugin version |
description | The plugin description |
class | The main plugin class |
type | The type of plugin (e.g., policy, reporter) |
{% hint style="warning" %} The plugin identifier must be unique for the APIM Gateway to load it correctly {% endhint %} {% endtab %} {% endtabs %}
{% hint style="info" %} See this page to learn how to deploy your custom plugin {% endhint %}