Jenkins - Code Analysis Plugin Installation

Manage Jenkins Plugins 

By adding, removing, or disabling, enabling plugins gives extended functionality of Jenkins. 

Steps to Install plugins (Hudson Selenium Plugin) 

Step 1 -  Go to Manage Jenkins -->Manage plugins  

Step 2 − Find the required plugin from search bar (Hudson Selenium Plugin) and choose to install. Restart the Jenkins instance. 

Step 3 − Go to Configure system 

Step 4 − Configure the selenium server jar and click on the Save button. 

Note: jar file can be downloaded from http://www.seleniumhq.org/download/ 

Step 5 − Go back to your dashboard and click on the Configure option for the HelloWorld project and click on Add build step and choose the option of “SeleniumHQ htmlSuite Run” 

Step 6 − Add the necessary details for the selenium test. Here the suiteFile is the TestSuite generated by using the Selenium IDE. Click on Save and execute a build. Now the post build will launch the selenium driver, and execute the html test. 

Code Analysis Plugin 

This plugin provides utilities for the static code analysis plugins. Jenkins can parse the results file from various Code Analysis tools such as CheckStyle, FindBugs, PMD etc. For each corresponding code analysis tool, a plugin in Jenkins needs to be installed. 

Additionally the add-on plugin Static Analysis Collector is available that combines the individual results of these plugins into a single trend graph and view. 

The plugins can provide information such as 

  • The total number of warnings in a job 

  • A showing of the new and fixed warnings of a build 

  • Trend Reports showing the number of warnings per build 

  • Overview of the found warnings per module, package, category, or type 

  • Detailed reports of the found warnings optionally filtered by severity (or new and fixed) 

Uninstall Plugins 

To uninstall a plugin, Go to Manage Jenkins → Manage plugins. Click on the Installed tab. Some of the plugins will have the Uninstall option. You can click these buttons to uninstall the plugins. Ensure to restart your Jenkins instance after the uninstallation. 

Installing another Version of a Plugin 

Sometimes it may be required to install an older version of a plugin, in such a case, you can download the plugin from the relevant plugin page on the Jenkins web site. You can then use theUploadoption to upload the plugin manually. 

E-mail notification 

Jenkins comes with an out of box facility to add an email notification for a build project, which is a post build activity.  

Step 1 − Configuring an SMTP server. Goto Manage Jenkins → Configure System. Go to the E-mail notification section and enter the required SMTP server and user email-suffix details. 

Step 2 − Configure the recipients in the Jenkins project - When you configure any Jenkins build project, right at the end is the ability to add recipients who would get email notifications for unstable or broken builds. Then click on the Save button. 

Apart from the default, there are also notification plugin’s available in the market. An example is the notification plugin from Tikal Knowledge which allows sending Job Status notifications in JSON and XML formats. This plugin enables end-points to be configured as shown below. 

Here are the details of each option − 

  • "Format"− This is the notification payload format which can either be JSON or XML.
  • "Protocol"− protocol to use for sending notification messages, HTTP, TCP or UDP.
  • "Event"− The job events that trigger notifications: Job Started, Job Completed, Job Finalized or All Events (the default option).
  • "URL"− URL to send notifications to. It takes the form of "http://host" for HTTP protocol, and "host:port" for TCP and UDP protocols.
  • "Timeout"− Timeout in milliseconds for sending notification request, 30 seconds by default.

Summary

SAST configuration for code analysis and Email notification to end-user, are Major functionality used in Jenkins to facilitate Developer to catch early bug and fixed it asap.

Please let me know your feedback in the comment box.