Developing External Plugins
You can build customizations on the Extension Point Framework using External Plugins.
For more information about the differences between external plugins and embedded extensions, see the options for extending the platform documentation.
Creating a New Plugin
Open a terminal window in the folder where you keep your Git projects.
note
mvn archetypecommand in an upcoming step will create a new subfolder automatically.Use the form below to generate the required archetype command:
Run the command generated by the form above to create the plugin folder.
note
Maven creates a basic plugin module in a subfolder named after the
artifactId. You can rename this folder if you wish.Go to the plugin folder and run the
git initcommand to initialize the Git repository.Open the plugin module in your IDE.
Open the extension class.
Update the extension class to implement the appropriate Extension Point interface.
Update the
@XPFAssignmentannotation to specify the appropriate Extension Point key.Implement the methods required by the Extension Point interface.
Build your plugin module with
mvn clean install.Open the
ep-commercerepo in your IDE.Open the
ext-plugin-configmodule POM (Project Object Model) file.Add a dependency for the plugin module that you just created.
(Optional) Follow the deploy instructions for details on how to specify plugin and extension configuration files, to pass the setting values.
Once the plugin and optional configuration files have been added to the ext-plugin-config module, it will be automatically loaded by all Elastic Path Commerce services that are started locally using mvn tomcat8:run-war or deployed using CloudOps. For more information, see Deploying External Plugins.
Updating and Testing your Plugin
To update and test your plugin, we assume that you already have one or more Elastic Path Commerce services running locally, such as Cortex, with your external plugin deployed. You have made some changes to your plugin and want to deploy them without restarting the Elastic Path Commerce services.
Open a terminal window in the folder where your plugin source code is located.
Build your plugin using
mvn clean install.Unload the old plugin by using the
unload.sh <service> <version>command, where<service>is the name of the EPC service you are testing on, such ascortex, and<version>is the current version number of your plugin.Re-load the new plugin using the
load.sh <service> <version>command, where<service>with the name of the EPC service you are testing on, such ascortex, and<version>is the current version number of your plugin.Test your changes normally.