How to integrate Sonarqube with Jenkins (Windows 7/8 64 bit)_
Many of us are working on automation testing where we need to write thousand lines of code to automate test cases. while writting code, one has to follow the standard. One has to put write logic which helps in optimizing your code and performance.
Here is tool SonarQube which explains about how to install/configure it for continuous integration and improving code quality.
1) One needs to have Jenkins server 2.138.1 installed and service up and running.
Many of us are working on automation testing where we need to write thousand lines of code to automate test cases. while writting code, one has to follow the standard. One has to put write logic which helps in optimizing your code and performance.
Here is tool SonarQube which explains about how to install/configure it for continuous integration and improving code quality.
Main reason of using this is opensource platform continuous inspection of code quality.It helps in various task and provide report on duplicate code, code standard, unit test, code coverage, complex code etc...
Let's go over setting up SonarQube with Jenkins.
Pre-requisite:
1) One needs to have Jenkins server 2.138.1 installed and service up and running.
2) Download SonarQube from web and unpack the zip file and copy that folder anywhere on your system.
3) Let's run
C:\Users\<username>\Downloads\sonarqube-7.3.zip\sonarqube-7.3\bin\windowsx86-64\StartSonar.bat
4) One needs to have Maven project which is commited to respective repository and integrated with Jenkins.
5) Go to settings.xml file where maven is installed.
For e.g.
C:\Users\<Username>\apache-maven-3.3.9\conf\settings.xml
Add following in above file..
<pluginGroups>
<!-- pluginGroup
| Specifies a further group identifier to use for plugin lookup.
<pluginGroup>com.your.plugins</pluginGroup>
-->
<pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
</pluginGroups>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>http://<jenkinsServerIP>:9000
</sonar.host.url>
</properties>
</profile>
6) Add the following dependency in pom.xml file of your respective project.
<build>
<finalName>arcVirtualQueuing</finalName>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.3.0.603</version>
</plugin>
</plugins>
</build>



