This plugin integrates Sonargraph into your build. Sonargraph allows to define an architecture for a software system and automatically checks how the code base conforms to it.
Sonargraph analyzes the static (i.e. compile-time) dependencies of your software. The free-of-charge license for the integration with Jenkins and also SonarQube allows to detect cyclic dependencies and additional metrics. You can mark the build as "unstable" or "failed" if cyclic dependencies are detected.
The Sonargraph Build component integrates Sonargraph in Ant and Maven based builds. This Jenkins plugin allows to define if the build should be marked as "unstable" or "failed" if architecture violations, cyclic dependencies, etc. are detected. Trends of metrics are displayed in charts and additionally the generated detailed HTML report is available for each build.
If you already have Sonargraph integrated in your build, use the post-build step called "Sonargraph Report Analysis".
If you are new to Sonargraph, we advice you to register on our Sonargraph Web Site, have a look at the whitepapers and screencasts to get an idea of Sonargraph's capabilities.
If you are new to Sonargraph and your build is based on Maven, use the post-build step called "Sonargraph Report Generation & Analysis".
If you are new to Sonargraph and your build is not based on Maven, you need to install Sonargraph on your build server and generate the Sonargraph report during one of your build steps. This report can then be evaluated in the post-build step called "Sonargraph Report Analysis".
NOTE: This Jenkins plugin requires Sonargraph version 7.1.9 and newer.
To see the global configuration options after installing the plugin, go to "Manage Jenkins" -> "Configure System". You will find the "Sonargraph Plugin" section
NOTE: This configuration is only required when you are going to use the "Sonargraph Report Generation & Analysis" post-build action.
Set the global options for Sonagraph as follows:
You can use the hello2morrow web site, section "Your licenses" for managing license files and activation codes.
NOTE: If you haven't already used Sonargraph in your Maven build, you have to make sure that you specify the following plugin repository either in Maven's settings.xml, or in the project's pom.xml:
Use this post-build action for projects that are already using Sonargraph Build. This action analyses the generated report and allows to configure the overall result of the build depending on the results of the analysis. If you have a project that relies on ANT based builds this is the way to go to add Sonargraph functionality into your build job in Jenkins.
Make sure that you use the same values for the parameters "report directory" and "report name" that you have configured in your existing Sonargraph Build integration.
The following parametern must be supplied to configure this post-build action:
Use this post-build action for integration of Sonargraph into Maven based projects that are not already configured to use Sonargraph Build. It will run Sonargraph's Maven goal generating XML and HTML reports for further analysis by this plugin.
After installing the Sonargraph plugin into Jenkins, go to the "Post-Build Actions" and select "Sonargraph Report Generation & Analysis". The following options will be displayed:
The following parameters must be supplied to configure this post-build action:
Both "Sonargraph Report Analysis" and "Sonargraph Report Generation & Analysis" post-build steps share the same basic and advanced options:
For every Sonargraph metric supported by this plugin, you have the following options:
Take into account that if you have set to mark the build unstable for one metric, failed for any other and both metric's value are greater than zero, the worst state will prevail, so the build will be marked as failure in this case.
Known issue: In multi-module projects the goal "package" is executed again (skipping the tests) as in some cases sub-modules are reported as missing.
Sonargraph post-build steps allow the configuration of metrics that will be displayed in the Sonargraph Job Page (See next section "Sonargraph Job Page"). You have the following options:
For each job that the Sonargraph Jenkins Plugin is configured, a page is available that shows short-term trends of metrics for the last 25 builds and long-term trends of metrics for the complete job life-time.
To achieve reasonable performance for the creation of the charts, the number of sampling points for the long-term charts is limited to 300. If there are more sampling points available the data set is reduced by calculating averages for adjacent points. The displayed long-term trend is a 24h moving average.
Sonargraph's Jenkins integration uses default Jekins mechanism to provide feedback to the user about the events that occur during the execution of the post-build actions or the generation of the graphics. To enable this feature follow these steps:
You will now see an entry for the Sonargraph logger as shown in the image:
When first created this logger is going to be empty and you will be able to see messages as the post-build actions are executed and graphics are generated. Take into account that the messages will appear sorted by date in a descending order, meaning that most recent entries will be shown at the top.
Will be elaborated in the future.
If your question is not answered here, please have a look at the Sonargraph_User_Manual.pdf contained in <sonargraph-inst-dir>/doc/pdf.
Skip to end of metadata Go to start of metadata