DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Coding
  3. Frameworks
  4. SonarQube 6.7 Server and SonarLint 3 Eclipse Plugin Installation

SonarQube 6.7 Server and SonarLint 3 Eclipse Plugin Installation

Part of being a performance tester is knowing all the tools at your disposal. Learn how to get a project up and running with this open source testing tool.

Shrisowdhaman Selvaraj user avatar by
Shrisowdhaman Selvaraj
·
Dec. 11, 17 · Tutorial
Like (11)
Save
Tweet
Share
113.46K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, I will explain the steps to:

       1. Configure SonarQube in Eclipse with the SonarLint plug-in.

       2. Configure an Eclipse project with a SonarQube centralized server/local server.

SonarQube is used for Code Quality Analysis and provides the capability to not only show the health of an application but also to highlight issues newly introduced. With a Quality Gate in place, you can fix the leak and therefore improve code quality systematically.

SonarQube is internally using PMD, Findbugs, CheckStyle, etc. If needed, we can add additional plugins according to our requirements. For Example, we can add JUnit additional plug-ins.

Configuring SolarLint 3.3 Plugin in Eclipse  

Once, sonorLint is configured in Eclipse, it'll help to identify errors or bugs in development phase itself. sonorLint analyzes the source code and if any errors show up in the sonorLint console, the developer will be notified while editing the code.

Step 1: 

Check the Java configured on your local pc.

Image title

Step 2: Download the Eclipse sonarLint plugin

Eclipse->help->Eclipse MarketPlace->Type sonarLint ->click install (Restart eclipse after it has been installed successfully).

Image title

Step 3: 

To run sonarLint automatically, enable the checkbox under project properties. It helps developers to highlight errors and bugs while writing code.

Project->Properties->sonarLint   

Image title

Step 4:

Select the SonarLint console to view the sonarLint log.

Image title

Step 5: 

How do you use the sonarLint report?

  • Every Save, sonarLint Start analyzes the code and the report is shown in the SonarLint-on-the-fly Report tab.

Image title

  • To view issues, click the SonarLint On-The-Fly tab.Image title 
  • To view the Rule Description:
    • Right-click and select Rule description.Image title
    •   Rule descriptionImage title

Steps to Configure an Eclipse Project in a SonarQube Centralized/Local Server

Step 1: 

     Download related software and configure it to your local machine: 

        1. sonarqube-6.7

        2. sonar-scanner-3.0.3.778-windows

Step 2:

Unzip sonarqube-6.7 and sonar-scanner-3.0.3.778-windows in your local directory under the sonar main directory.

Image title

Step 3:

Set environment variables for sonar-scanner-3.0.3.778-windows.

Image title

Step 4:

Create the project in the SonarQube server by editing the sonar-scanner.properties file under D:\Development\Sonar\sonar-scanner-3.0.3.778-windows\conf directory. 

Image titleStep 5:

  • Run sonarqube-6.7 server.Image title

Note: The sonarqube-6.7 bin directory contains an (Windows, Linux, Mac) operating system boot file. Refer to the screenshot below. I have run my SonarQube server in windows-x86-64 directory because my PC is 64-bit, You can choose you preference based on your system configuration. Image title

  • Run SonarScanner to map the project in the SonarQube server.Image title
  • Login to the SonarQube web server with a default link:
    • http://localhost:9000
    • Default credentials : admin/adminImage title

Step 6:

Bind an Eclipse project with a SonarQube project by clicking:

Project ->SonarLint->Bind to sonarQube Project

Image title

Click 'Auto bind selected project.' It helps to bind automatically with the SonarQube server. 

Note: We have already created the project name, “JavaProject,” and run the SonarScanner and created the project name in the SonarQube server.

  • Connect to the SonarQube Local server:Image title
  • Pass the SonarQube server URL and click Next.Image title
  • There are two methods to connect to the server. I have chosen to use my username/password and passed default credentials (admin/admin) to pass the test connection.Image title  
  • After Auto bind, selecte your project.Image title
  • Run the SourceQube analyzer by clicking the Analyze button. Image title
Eclipse

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • TDD: From Katas to Production Code
  • Data Mesh vs. Data Fabric: A Tale of Two New Data Paradigms
  • Comparing Kubernetes Gateway and Ingress APIs
  • Leaders Make Their Own Problems

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: