Advanced Jenkins Plugin Development: Adding Sidebar Options and New Pages
This article explains how to extend a Jenkins plugin by creating a custom Action class to pass data to job pages, adding a sidebar option, and implementing a new configuration page using Jelly templates, with step‑by‑step code examples and deployment instructions.
Previously, an introductory article covered the basics of creating a Jenkins plugin, including environment setup, project creation, and directory structure. This follow‑up focuses on extending the plugin's functionality.
The first enhancement adds a custom option to the job sidebar. To achieve this, a new class FireLineScanCodeAction is created in the same package as FireLineBuilder, implementing the Action interface. The required methods getUrlName(), getIconFileName(), and getDisplayName() are implemented, and a field with its getter is added to carry data to the job page.
Next, the plugin registers an instance of FireLineScanCodeAction inside the perform method of FireLineBuilder, ensuring the action is attached to each build.
The second enhancement introduces a new page. The Action class is updated with icon and URL names, and a corresponding Jelly view is added under
src/main/resources/com/qihoo/fireline/FireLineScanCodeAction/index.jelly. This view defines the UI displayed when the sidebar option is selected.
After adding the code and resources, the plugin can be run with mvn hpi:run. By creating a new Jenkins job, enabling the "Execute FireLine" build option, and saving, the sidebar now shows the "FireLine Static Analysis" entry, confirming that data is successfully passed and the new page is accessible.
The article notes that further topics such as custom icons and extending ProminentProjectAction will be covered later, and invites readers to provide feedback due to limited existing documentation on Jenkins plugin development.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
360 Quality & Efficiency
360 Quality & Efficiency focuses on seamlessly integrating quality and efficiency in R&D, sharing 360’s internal best practices with industry peers to foster collaboration among Chinese enterprises and drive greater efficiency value.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
