Page decoration plugins for Jenkins, SonarQube, and Nexus
While trying to apply a unified visual layout to the tools Jenkins, SonarQube, and Nexus I learned that there are some plugins available, but none of them really fits the intended purpose.
Jenkins has no easy way of changing its appearance and the Simple Theme plugin comes only close to what is needed. In SonarQube there is a Branding plugin with which you can display an image at the top of each page, but that’s basically all. The Nexus plugin to change the Sonatype Nexus logo is available for the professional version only, but buying the professional version just for being able to change the logo is not really an option.
Analyzing the APIs of the different tools revealed that similar extension points are offered in order to inject HTML fragments into the HTML page:
- Jenkins: hudson.model.PageDecorator
- SonarQube (since 3.3): org.sonar.api.web.PageDecoration
- Nexus: org.sonatype.nexus.plugins.rest.NexusIndexHtmlCustomizer
For Jenkins and SonarQube I found plugins which use these extension points, although the plugins are not available via the official plugin repositories and therefore somewhat hidden from the public:
- Jenkins: page-markup (GitHub)
The original Subversion repository has been forked to GitHub but the plugin has not made it into the Jenkins Plugin Repository yet. - SonarQube: sonar-pagedecoration-plugin (GitHub)
It seems as if there has been no attempt at getting the plugin into the SonarQube Plugin Forge yet. - Nexus: No plugin available or at least I did not find one yet.
Inspired from the Blog postings “Nexus and UI contributions” and “Extending Nexus UI” I decided to write my own plugin which matches the functionality of the SonarQube’s pagedecoration and the Jenkins’s page-markup plugins.
The new nexus-pagedecoration-plugin adds a menu item “Page Decoration” to the Administration section of the Nexus UI:
[]
(http://2.bp.blogspot.com/-Ni1gkHRtdxA/UwoGugngvGI/AAAAAAAAcZQ/ZySSX11ac-8/s1600/2014-02-23+15_33_10-Clipboard.png)
The corresponding Page Decoration tab provides text areas for all the four extension points:
- Pre Head
- Post Head
- Pre Body
- Post Body
You can add HTML fragments to each of the text areas and when saving the changes and reloading the page, the fragments will be rendered into the Nexus UI HTML page.
[]
(http://1.bp.blogspot.com/-dzOV41d622g/UwoHbwRdt_I/AAAAAAAAcZY/WwVimvnJwfs/s1600/2014-02-23+15_35_57-Sonatype+Nexus.png)
The nexus-pagedecoration-plugin is available under the Apache 2.0 license and is hosted on Github. The initial release for Nexus 2.7.1-01 can be found under GitHub releases.
For the other plugins I did a fork on GitHub and made some releases on GitHub:
- page-markup release: v0.4-SNAPSHOT
- sonar-pagedecoration-plugin release: v1.0.1-SNAPSHOT
- nexus-pagedecoration-plugin release: v2.7.1-01