Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Blueriq Model Analyzer consists out of three components: Blueriq Sonar Plugin, Blueriq Quality Gate, Blueriq Sonar Scanner. Only the Blueriq Sonar Plugin and the Blueriq Quality Gate . This page will explain how to install and setup all of these componenthave to installed before being analyzing your Blueriq Models. The Blueriq Sonar Scanner it used to execute the analysis and only has be available on the machine from which you want to execute the analysis.

Installation requirements

...

The Blueriq Sonar Plugin is a plugin for SonarQube, which makes it possible to perform an executes the analysis on you your Blueriq Models created in the Blueriq Studio. The Blueriq Sonar Plugin needs to be placed inside a SonarQube instance. This manual will provide information on how to install SonarQube and how to place the Blueriq Sonar Plugin in the correct directory of Sonarqube so it becomes available.

...

When the Blueriq Sonar Plugin is in place, start the SonarQube service by running the StartSonar.bat in the subdirectory of the bin folder corresponding to your operating system. For instance /sonarqube-5.6.6/bin/windows-x86-x64

Configure Maven POM file

Finally, Maven and SonarQube need to be configured with the correct properties to be able to read your Blueriq Model of interest. Maven takes care of this by reading a pom.xml file.

Tip
titleSetting up configuration

Setting up a default configuration can be done through the SonarQube administration options. We have some suggestions for Setup in an enterprise landscape.

You will have to create the pom.xml yourself, and then configure it for your own Blueriq installation, repository, branch and project(s).

Below, you can find

  • An example of a pom.xml
  • The location where to save the pom.xml
  • An explanation of the properties in the pom.xml

An example configuration in this pom file looks like this:

Code Block
languagexml
titleExample
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>SingleModule</groupId>
  <artifactId>singlemodule-test</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>SingleModuleTest</name>
  
    <properties>
        <sonar.blueriq.managementservice>http://my-studio-server/Studio/Server/Services/ManagementService</sonar.blueriq.managementservice>
        <sonar.blueriq.repository>RubikTest</sonar.blueriq.repository>
        <sonar.blueriq.branch>Trunk</sonar.blueriq.branch>
        <sonar.blueriq.projects>Kinderbijslag,TestProject</sonar.blueriq.projects>
        <sonar.blueriq.username>admin</sonar.blueriq.username>
        <sonar.blueriq.password>welcome</sonar.blueriq.password>
        <sonar.blueriq.authentication>BASIC</sonar.blueriq.authentication>
        <sonar.blueriq.skipanalysis>false</sonar.blueriq.skipanalysis>
        <sonar.blueriq.workingDir>target/bq</sonar.blueriq.workingDir>
    </properties>
</project>

...

Image Removed

The properties in the pom file:

...

sonar.blueriq.managementservice

...

Url to the management service, if this property is set then all other managementservice properties must also be set. If this is not set, then the branchexportlocation must be set.

...

sonar.blueriq.repository

...

Name of the repository.

...

sonar.blueriq.branch

...

Name of the branch.

...

sonar.blueriq.username

...

Studio username credential.

...

sonar.blueriq.password

...

Studio password credential.

...

Blueriq Quality Gate

The Blueriq Quality Gate is a SonarQube Quality Gate, more information about quality gates can be found here.

Adding Blueriq Quality Gate

The Blueriq Quality Gate called bma-qualitygate-installer.jar can be runs by using java -jar bma-qualitygate-installer.jar. When running this command you will be prompted with several questions.

Prompt

Input

hostnameThe url to your SonarQube instance. This should be either yoururl.here[:PORT] or http[s]://yoururl.here[:PORT]/
usernameA username for a user with the Administer Quality Gates permission. (default: admin)
passwordThe password for the above mentioned user. (default: admin)

Clean install? (y/n)

Decide whether to delete the current quality gate and overwrite it with a new one. If the answer is not "Y", the script will only install missing conditions.

Image Added

Info
titlecommand line arguments

It is possible pass command line arguments into the bma-qualitygate-installer.jar for information see this page

During the installation of the Blueriq Quality Gate you will informed of the progress. After the Quality Gate installation is finished, you can verify that the Blueriq Quality Gate is present in SonarQube. This can be done by navigating to the Quality Gates tab in SonarQube.

Image Added

Blueriq Sonar Scanner

The Blueriq Sonar Scanner is a SonarQube Scanner. A SonarQube Scanner is a tools to analyze your projects. For Blueriq we have introduces our own Blueriq Sonar Scanner, do to implications we cannot provide an analysis using the default SonarQube Scanners. The Blueriq Sonar Scanner is Spring Boot Java Command Line Interface runner, which can be used to execute the analysis of your Blueriq Models.

Where to place the Sonar Scanner

The Blueriq Sonar Scanner is used to execute the analysis of you Blueriq Models. Commonly quality analysis is executeed on Continuous Integration(CI) Server like for instance Jenkins. With the older versions of the Blueriq Model Analyzer it was possible to use the Maven Sonar Scanner to execute an analysis, and therefor only a connection to a central maven repository had to be setup. From the Blueriq Model Analyzer version 3 or higher you will need to place the Blueriq Sonar Scanner called bma-sonar-scanner.jar on the environment you which to execute the analysis from. 

For example if you want to execute an analysis on your CI Server, you will need to place the bma-sonar-scanner.jar somewhere on the system of your CI Server. If you want to execute an analysis on locally on your own environment, you will need to place the bma-sonar-scanner.jar somewhere on your local environment. 

Performing an Analysis

See the User documentation on how to execute an analysis of your Blueriq Models

...

sonar.blueriq.projects

...

A comma separated list of blueriq project names.

...

Set to true if the BMA plugin shouldn't be triggered for the current project. This is useful when scanning projects without Blueriq, or when no connection can be made to the management service.

The following properties are default SonarQube properties. More information can be found here.

...

sonar.host.url

...

localhost:9000

...

Url and port to the sonarQube host.

...

The installation is now completed. You should be able to analyse your Blueriq Models now.