SonarQube is an open source tool to manage code quality of
an application. It manages seven axes of code quality such as Architecture
& Design, Duplication's, Unit Tests, Potential Bugs, Complexities, Coding
Rules, and Comments.
It covers many programming languages such Java, JavaScript,
JSON, Objective-C, PHP, PL/I, PL/SQL, Puppet, Python, RPG, Swift, VB.NET,
Visual Basic 6, Web, and XML etc.
Installing SonarQube
1.Download sonar from http://www.sonarqube.org/downloads/
2. Extract installable directory from the zip file and go to
bin sub-directory.
3. Based on the operating system, select the installable
directory and run the StartSonar.bat
4.Once Sonar is up and running, Open browser and visit http://localhost:9000/ or http://<IP_Address>:9000/ . We will get
the Sonar dashboard.
5.For Jenkins and Sonar integration security token is
required.
6.To generate Token SonarQube Dashboard > Top Right
Corner > MyAccount >Security >Generate Token & Copy the Token, we
will use in Jenkins
Jenkins & Sonar Integration
We have already Configured Java & Maven Project , Now we will integrate Sonar to that Project.
Please refer in case of missing/ re-configure Configuring Build job for Java Application with Maven
1.Manage Jenkins >
Manage Plugins > Search : SonarQube , Install with out restart
2.Now we have to add SonarQube Severs, for that go to Manage Jenkins > Configure System >
add SonarQube Severs: provide Sonar Details & Token
3. In Global
Tool Configuration, configure SonarQube Scanner installations also.
4.
Once all Sonar related installations and configurations are completed,
we need to add Build step to execute SonarQube Scanner. Just add below Step, no
need to configure anything, leave it as it is.
5.Make sure sonar-project. properties file
is available in your project
6.Build the Job, once Job completed, check Sonar UI








0 comments:
Post a Comment