EzyPlatform Plugin Development Quickstart

Updated at 1784975202000

Overview

This post walks through everything you need to go from zero to a working EzyPlatform plugin running on your machine. It's a roadmap for developers who are new to building plugins/themes for EzyPlatform, pulling together the existing detailed guides in the order you should actually follow them.
If you prefer learning by video, check out the EzyPlatform Theme & Plugin Programming course, which follows roughly the same path as this post.

Prerequisites

Before you start, make sure your machine has:
  1. JDK 8 (EzyPlatform currently runs on JDK 8).
  2. MySQL as the database.
  3. Apache Maven to build the project.
  4. IntelliJ IDEA (the Community edition is enough).

Install EzyPlatform (without Docker)

First, you need a local EzyPlatform server for your plugin to be installed into and tested against.
Main things to do:
  1. Install JDK 8 and set the JAVA_HOME environment variable, then verify with java -version.
  2. Install MySQL.
  3. Download the EzyPlatform package and extract it.
  4. Open settings/setup.properties and fill in your MySQL connection details.
  5. Run bash cli.sh "console admin" (Linux/MacOS) or .cli.bat "console admin" (Windows). Once you see EZYHTTP READY, the admin server has started successfully.
  6. Go to http://localhost:9090/setup-admin to create your first super admin account.
It's also a good idea to set an `EZYPLATFORM_HOME` environment variable pointing to your installation folder — it makes the later steps easier to manage.
Detailed guide: Install EzyPlatform

Install the EzyPlatform SDK

The EzyPlatform SDK provides the ezy.sh/ezy.bat command-line tool, which lets you scaffold plugin projects, export modules, link plugins, and more, instead of doing everything by hand.
Main things to do:
  1. Download the EzyPlatform SDK from ezyplatform.com and extract it, for example into app/ezyplatform-sdk.
  2. Set the EZYPLATFORM_SDK environment variable to point to that folder.
  3. Add $EZYPLATFORM_SDK/bin to your PATH so you can call ezy.sh/ezy.bat from anywhere.
  4. Clone the ezyplatform-development repository and run bash build.sh (or .build.bat on Windows) to build the shared libraries needed for plugin development.

Install IntelliJ IDEA

Download and install IntelliJ IDEA if you don't already have it — the free Community edition at [github.com/jetbrains/intellij-community](https://github.com/jetbrains/intellij-community) works fine. This is the IDE you'll use throughout the rest of the guide to import, build, and run your plugin.

Create a plugin

Once the SDK is set up, use the ezy.sh cp (create project) command to scaffold a new plugin project with the standard structure.
For example, to create a project called hello-world with admin plugin, theme, and web plugin modules:
ezy.sh cp hello-world -g com.example -i admin-plugin,theme,web-plugin
After that:
  1. Import the project into IntelliJ as a Maven project.
  2. Run bash export.sh (or .export.bat) to export the modules to your local EzyPlatform server.
  3. Run the HelloWorldAdminPluginStartupTest test class to start the server in dev mode.
  4. Go to http://localhost:9090, log in as admin, and activate the plugin you just created.
Note: In IntelliJ, change the run configuration's working directory to the specific module's folder instead of leaving it at the project root — this is what makes static assets (CSS/JS/images) auto-reload when you edit them.
Detailed guide: Create a plugin

Fix IntelliJ not recognizing path variables (if needed)

On Windows, IntelliJ sometimes fails to pick up environment variables like EZYPLATFORM_HOME, which breaks the build. If you run into this, work through the following escalating steps and stop as soon as the error is gone:
  1. Create the EZYPLATFORM_HOME environment variable at the OS level.
  2. Re-declare that path variable in IntelliJ's settings.
  3. Add the VM option -Denv.EZYPLATFORM_HOME=/your/path plus a matching environment variable in your Maven configuration (both for importing and running).
  4. Set it directly in the project-level run configuration, on the startup class itself.

Learn the plugin project structure

Before writing code, it's worth spending a few minutes reading through the project structure generated in step 4 so you know where things go. A plugin project typically has these modules:
  • admin-plugin: models, controllers, static files, and templates for the admin interface.
  • sdk: shared classes used across the other modules.
  • socket-app / socket-plugin: handles socket-based communication.
  • theme: web theme resources.
  • web-plugin: models, controllers, and views for the web-facing side.
Each module follows standard Maven conventions (src/main/java, src/main/resources), where static/ holds images/CSS/JS and templates/ holds Thymeleaf templates. Two config files matter most: module.properties (module metadata, required for every module except sdk) and menus.properties (admin sidebar menu definitions).
You can also look at the book-store example on GitHub to see how a real plugin is organized.

Link a plugin

When your plugin needs to reuse another plugin's API or source code (say, EzyArticle), you "link" that plugin into your project instead of rewriting it from scratch.
Main things to do:
  1. Make sure EzyPlatform is running, then download the plugin you need (e.g. EzyArticle) from the marketplace and activate it.
  2. From your project's root directory, run the link command:
ezy.sh link ezyarticle
(on Windows, use ezy.bat link ezyarticle)
  1. Verify the result: the relevant modules' `pom.xml` files will have the new dependency added automatically, and the linked plugin's package will show up in the @ComponentsScan of the XxxStartupTest classes.
Once linked: a linked admin plugin adds menu items to the admin sidebar, a linked web plugin exposes additional APIs you can call, and a linked socket plugin makes its socket controllers available to you.
Note: You need the EzyPlatform SDK installed (step 2) before you can do this.
Detailed guide: Link a plugin

What's next

After completing these 7 steps, you will have a working plugin running on your local EzyPlatform. From here, you can explore the EzyPlatform CLI commands to manage the server more conveniently, or go deeper with the EzyPlatform Theme & Plugin Programming course.

Table Of Contents