SCM-Manager - Why Plugins?
Why We Make Plugins
If you have installed SCM-Manager before, you may have noticed how simple and small SCM-Manager is compared to other source control management solutions. The main reason for this is that tons of features are excluded from your default installation and can be easily added as plugins. Also, this modular approach allows you to easyly add your own features to SCM-Manager. With this short blog post series we want to show you to develop your own plugins for SCM-Manager.
First, some SCM-Manager Basics
Let’s get started with the basics you should know before writing your first SCM-Manager plugin.
- The SCM-Manager backend is written almost entirely in Java.
- The frontend is written using React with TypeScript support.
- The communication between the frontend and the backend is handled via HTTP requests using a Level 3 REST API.
- SCM-Manager provides a powerful plugin API which is based on Java annotations, a large set of public interfaces, a central event bus and different kinds of extension points, which will all be explained in the following blog posts.
Plugin Architecture
What else do you need to know about plugins?
Plugins allow you to extend the functionality of SCM-Manager in various ways without touching SCM-Manager core itself.
Therefore, it is very important to keep the core api’s easy-to-use and prevent breaking changes.
A single plugin always depends on a minimum SCM-Manager version.
It can also depend on other plugins, which can be marked as required or optional.
The Jira Plugin for example cannot work without the Issue Tracker Plugin, since some basic functionality is implemented in the latter.
Of course, these dependencies are not only important during your development, but also for everybody who wants to use the plugin.
If you install a plugin on your SCM-Manager but the required dependencies are not satisfied, the server cannot start up at all.
You can find the required dependencies for each plugin in the build.gradle
file respectively the package.json
file.
To try out your plugin during development, you simply can start it with the Gradle Run-Task: ./gradlew run
.
This will start the SCM-Manager in the version your plugin depends on with your plugin included.
If you want to use the plugin on your own SCM-Manager just use ./gradlew build
instead. You will get the plugin artifact as a .smp file.
This file format is a zipped package with all plugin related information like Java classes, frontend bundles and other configurations.
To install your scm-example-plugin.smp on any SCM-Manager instance, just copy this file into your scm-home/plugins directory and restart your SCM-Manager.
Figure 2: Plugin build directory with the smp file
By our experience, most plugins have both frontend and backend integration, but it is also possible for a plugin to only consist of one of these. If you are missing extension points or core APIs for your plugin, do not hesitate to contact the SCM-Manager team.
Plugin Community
After you created your first plugin, you may want to share it with the whole SCM-Manager community. For this purpose we already prepared an automatic infrastructure which makes it as easy as possible to publish your plugin into the official SCM-Manager plugin center and on the SCM-Manager website.
Just follow these steps:
- Push your code to GitHub as a public repository.
- Inform the SCM-Manager team that you have written a plugin which you would like to be published to the plugin center.
- The team will review your plugin’s code and may ask for some changes. If your plugin works as expected it will be added to the SCM-Manager GitHub organization. We will generate a Jenkins build job for your plugin and as soon as your plugin was build successfully it will be added automatically to the SCM-Manager plugin center.
- That’s it. Your plugin is now part of the official plugin center and is shown on the SCM-Manager website. You can extend this plugin by creating pull-requests. Also, you can contact the SCM-Manager if you want to apply as a maintainer for this plugin.
Figure 3: SCM-Manager plugin center
Not The End
This was a short rip-off, of how you can interact with the SCM-Manager plugin ecosystem. If you are ready to get started with your first plugin idea, check out our simple plugin creator. It will provide you with a plugin starter package, with which you can directly start your implementation.
With the next blog post of this series we will start to develop a real plugin together. From initialization, to frontend/backend integrations, to release into the SCM-Manager plugin center.
SCM-Manager
The easiest way to share and manage your Git, Mercurial and Subversion repositories.
Getting started
This article is part 1 of the series „Introduction to plugin development for SCM-Manager“.
Read all articles now: