This repository provides the standard structure and configuration for developing Directory Manager API plugins.
To create a new plugin from this template:
-
Create a new project on GitLab (e.g.
linid-dm-v2/your-plugin-name
). -
Clone your new repository:
git clone https://ci.linagora.com/linagora/lrs/LinID/linid-dm-v2/your-plugin-name.git cd your-plugin-name
-
Add this template as an upstream remote:
git remote add upstream https://ci.linagora.com/linagora/lrs/LinID/linid-dm-v2/template-dm-api-plugin.git git fetch upstream
-
Create a branch for the update:
git checkout -b feature/update_from_template
-
Merge the template into your project:
git merge upstream/main --allow-unrelated-histories
-
Resolve any conflicts, if necessary, then commit the result:
git commit -am "feat: integrate template"
-
Clean up: remove unnecessary template files and adjust the project to your plugin's purpose.
-
Push your branch:
git push -u origin feature/update_from_template
-
Create a merge request from your branch to
main
using the GitLab interface.
When a new version of the template is available, you can synchronize your plugin with the latest changes:
- Create a dedicated update branch:
git checkout -b feature/update_from_template
- Fetch and merge changes from the template:
git fetch upstream
git merge upstream/main
- Resolve any conflicts if needed.
- Push your branch and open a merge request:
git push -u origin feature/update_from_template
This template provides:
- Standard Maven project structure
- Common CI/CD configuration
- Shared plugin configuration and conventions
To build the project:
mvn clean install
This command compiles the code, runs tests, and verifies everything is working as expected.
If you're using the provided CI setup, your commits will also be checked for formatting and message style.
Use the script scripts/verify_commit_message.sh
if you want to validate your commit messages manually before pushing.
Unit tests use JUnit 5 and Mockito. To run tests:
./mvnw test
Modify or delete MyPlugin****PluginTest.java
as needed.
This template uses:
- Java 21
- Spring Boot 3.x (provided scope)
- JUnit 5
- Mockito
Dependency versions are managed via the Spring Boot BOM (spring-boot-dependencies
).
.
├── src/main/java/org/linagora/linid/myplugin/...
│ ├── MyPluginAuthorizationPlugin.java ← Example AuthorizationPlugin class
│ ├── MyPluginProviderPlugin.java ← Example ProviderPlugin class
│ ├── MyPluginRoutePlugin.java ← Example RoutePlugin class
│ ├── MyPluginTaskPlugin.java ← Example TaskPlugin class
│ └── MyPluginValisationPlugin.java ← Example ValidationPlugin class
├── src/test/java/org/linagora/linid/myplugin/...
│ ├── MyPluginAuthorizationPluginTest.java ← Example AuthorizationPlugin test class
│ ├── MyPluginRoutePluginTest.java ← Example RoutePlugin test class
│ ├── MyPluginTaskPluginTest.java ← Example TaskPlugin test class
│ └── MyPluginValisationPluginTest.java ← Example ValidationPlugin test class
├── template-ci.yml ← Template CI configuration (optional)
├── pom.xml
└── README.md
You can safely delete:
- The example plugin and test class (
MyPlugin****Plugin.java
,MyPlugin****PluginTest.java
) - The template CI (
template-ci.yml
andscripts/verify_commit_message.sh
) if you plan to use your own CI pipeline
- Update
groupId
,artifactId
, andversion
inpom.xml
with your own values. - Use
upstream
remote to keep the template up to date in your own fork.
This template is released under the LGPL-3.0 license by default. You can change the license according to your project or client requirements.
This plugin template follows the versioning of the dm-api-core
project.
Each release of the template is intended to be compatible with the corresponding version of dm-api-core
.
When dm-api-core
publishes a new version, this template may be updated accordingly to integrate any necessary changes or improvements.
If you are using this template in your plugin project, make sure to:
- Monitor
dm-api-core
releases - Regularly merge updates from this template (see ♻️ Updating from the Template)