Eclipse | Team features | Connected Mode setup

On this page

Connected Mode setup

Connection setup

SonarLint for Eclipse offers a Sonar connection wizard to help you set up Connected Mode; it can be accessed in two different ways:

  • Go to File > New > Other… to open Eclipse’s Select a wizard menu. Then, find SonarLint > New SonarQube/SonarCloud Connection and select Next.
  • Or, Right-click in the SonarLint Bindings tasks view tab and select New Connection…. This method will start the wizard right away.

Choose either SonarCloud or SonarQube, then select the Next button to continue:

Automatic setup

SonarQube 10.4+ offers the easiest way to set up Connected Mode: simply use the Open in IDE feature from SonarQube. You must trust the SonarQube server to store a token for the connection, and it's best if you already have the project open in your IDE. 

Check the Troubleshooting article if something doesn’t work right or follow the instructions below to manually create a SonarQube connection.

Create a new SonarQube Connection

Choose SonarQube and add server details to set up your connection with SonarLint.

1. When you select SonarQube, you will need to enter the server URL before selecting Next to proceed. The default URL is http://localhost:9000, but your URL might differ.

2. Choose your authentication method & authenticate:

  • Token: generate a user token in your SonarQube instance. This is the preferred way to avoid the compromise of your username & password. In SonarQube, go to https://<your-sonarqube-url>/account/security/ to generate a new user token.
  • Username + Password: this method can be used for a SonarQube connection only. It lets SonarLint use your credentials directly but is not the recommended method due to potential security risks.

3. Enter a Connection name so that you can find it later in the SonarLint Bindings view window, and click Next to continue.

4. Then, choose if you want to receive Notifications; you have the option to allow SonarQube or SonarCloud to send Smart Notifications to the IDE. Smart notifications make you aware of changes made on the server. Finally, select Finish to complete the Connection wizard.

The final steps involve binding your local project to the project on the server.

Create a new SonarCloud Connection

Choose SonarCloud and add server details to set up your connection with SonarLint.

1. You will be prompted to add a user Token generated by SonarCloud. If you don't already have a token, clicking the Generate token button will open the https://sonarcloud.io/account/security page in your default browser. Select Next to continue.

2. Start typing the name of your SonarCloud Organization and choose your organization from the filtered list that appears; your Organization Key will automatically populate the field. Select Next to continue.

3. Enter a Connection name so that you can find it later in the SonarLint Bindings view window. Click Next to continue. Connection Name is a friendly name for your connections.

4. Then, choose if you want to receive Notifications; you have the option to allow SonarQube or SonarCloud to send Smart Notifications to the IDE. Smart notifications make you aware of changes made on the server. Finally, select Finish to complete the Connection wizard. 

The final steps involve binding your local project to the project on the server.

Once set up, SonarLint will automatically check your SonarQube or SonarCloud organization’s project list against open or newly opened projects in your workspace to suggest a binding.

SonarLint will automatically prompt you to bind your project to the server.

Project binding

If you just created a new connection, the connection wizard will transition into a binding wizard where you can add projects that you want to bind. Or, you can select your SQ or SC server in the SonarLint Bindings tab, right-click, and select Bind Projects… to open the wizard, then Add… to open the Project selection window.

  1. The Project selection window presents a list of projects open in the Eclipse workspace. 
  2. In the next window, start typing the name of a project you have on the server; double-click on the matching project, and the wizard will grab and load the Project Key.
  3. Click Finish and check the progress bar in the lower right corner.

View connections

Connections and their bindings can be retrieved in the SonarLint Bindings view tab which is found by navigating to the File Menu > Window > Show View > Other... > SonarLint > SonarLint Bindings:

Right-clicking on a connection will open a tooltip to edit or delete the connection and can be useful, for example, to update credentials and bindings if they have changed.

You can view and manage your connections and bindings in the SonarLint Bindings view.

Right-clicking on a connection will reveal an option to select Update All Project Bindings.

SonarLint-SonarQube version support policy

SonarLint enables users to establish a connection to the latest SonarQube version and to the latest LTS version. When a new LTS version is released (approximately every 18 months), we still enable connecting SonarLint to the previous LTS version for a certain period of time (currently 12 months after the latest LTS release) to allow enough time for organizations to upgrade their SonarQube version. 

For more information about long-term support of SonarQube, check out our page describing "what is an LTS". And, to review IDE-specific requirements, please check the respective pages of the documentation as listed in the next paragraph.

⚠️ The 8.9LTS reached its support expiration date (in November ’23).

Learn more

Check out the main Connected Mode page to learn more about the benefits of using Connected Mode, information about SonarLint's branch matching strategy, and how to activate and deactivate your Sonar Smart Notifications in the IDE.

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License