Style Guides
This site is the new docs site currently being tested. For the actual docs in use please go to https://www.jenkins.io/doc. |
Plugin Naming Convention
Not all existing plugins may follow these rules, as those were established or enforced later. |
Artifact ID
A plugin’s artifact ID is used as the file base name and to uniquely identify the plugin in Jenkins and on update sites. It needs to follow some conventions to be published:
-
Use a lowercase ID, and separate terms with hyphens as needed.
-
Include neither
jenkins
orplugin
in the ID unless necessary for the name to make any sense at all.
For example, use snapchat-notification
instead of JenkinsSnapchatNotificationPlugin
or notification-plugin-for-snapchat
.
The ID cannot be changed after the first release; Jenkins would consider it a different plugin.
Name
A plugin’s name is shown to users on the Jenkins UI and elsewhere, such as the plugin site. If is recommended to use a short and descriptive name, like Subversion.
Including Jenkins or Plugin in the name to indicate that it is a plugin for Jenkins is redundant and discouraged, and these terms may be stripped from the name in some cases to ensure consistency in lists, and to shorten the name.
Group ID
All new hosting requests are instructed to use io.jenkins.plugins
as group ID.
We do not strictly prohibit other group IDs unless they’re in bad faith (e.g. referencing an organization you have no relationship with), but we strongly recommend using io.jenkins.plugins
to avoid confusion and use a standardized pattern.
Java Source Code
The Jenkins project generally follows the Oracle Java Code Convention but it’s not well enforced even in core components. Individual plugin maintainers sometimes choose to use different style guides for their plugins.
Commit Messages
Git commit messages should start with a reference to the Jira issue they’re related to, if applicable, followed by a short summary on the first line, and more details on subsequent lines. Example:
[JENKINS-00000] Frobnicate the widget
If a given commit fixes the specified issue, use of one of the following prefixes will make an automated infra process resolve the related Jira issue.
[FIX JENKINS-00000] Frobnicate the widget
[FIXED JENKINS-00000] Frobnicate the widget
[FIXES JENKINS-00000] Frobnicate the widget