# Connected mode setup

## Connection setup <a href="#connection-setup" id="connection-setup"></a>

SonarQube 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 **SonarQube** > **New SonarQube (Server, Cloud) 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 SonarQube Cloud or SonarQube Server, and select the **Next** button to continue. Follow the SonarQube Server instruction when connecting to SonarQube Community Build:

{% tabs %}
{% tab title="SONARQUBE SERVER" %}

#### **Automatic setup with SonarQube Server**

SonarQube and SonarQube Community Build offer the easiest way to set up connected mode: simply use the [#opening-issues-in-the-ide](https://docs.sonarsource.com/sonarqube-for-eclipse/using/investigating-issues#opening-issues-in-the-ide "mention") feature from SonarQube Server or SonarQube Community Build. You must trust 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-connected-mode-setup](https://docs.sonarsource.com/sonarqube-for-eclipse/resources/troubleshooting#troubleshooting-connected-mode-setup "mention") if something doesn’t work right or follow the instructions below to manually create a SonarQube Server connection.

#### **Create a new SonarQube Server Connection**

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2FEWcTRWlEc4SY1uMLcXkx%2Fsq-eclipse-select-sonarqube-server.png?alt=media&#x26;token=5ad50bf9-3319-4e08-bacb-0bc0498f0482" alt="Choose SonarQube Server and add your server details to set up your connection with SonarQube for Eclipse." width="375"><figcaption></figcaption></figure></div>

1\. Select **SonarQube Server** and select **Next** to continue.\
2\. Enter the server URL before selecting **Next** to proceed. The default URL is `http://localhost:9000`, but your URL might differ.

3\. Choose your authentication method & authenticate:

* **Token**: generate a *User token* in your [SonarQube instance](https://docs.sonarsource.com/sonarqube-server/instance-administration/security/administering-tokens). Selecting **Generate token** will open the `https://<YourSonarQubeURL>/account/security/` page in your default browser. You can always create a token manually, if needed. See the [Tokens](https://app.gitbook.com/s/LWhbesChsC4Yd1BbhHhS/instance-administration/security/administering-tokens "mention") page in SonarQube Server for more information.

{% hint style="warning" %}
*User tokens* are required when setting up connected mode or an MCP Server between SonarQube (Server, Cloud) and SonarQube for IDE. Note that the binding will not function properly if *project tokens*, *global tokens*, or *scoped organization tokens* are used during the setup process.
{% endhint %}

4\. Enter a **Connection name** so that you can find it later in the **SonarQube Bindings** view window, and click **Next** to continue.

5\. Then, choose if you want to receive Notifications; you have the option to allow SonarQube Server to send Smart Notifications to the IDE. [Connected mode #Smart notifications](https://app.gitbook.com/s/LWhbesChsC4Yd1BbhHhS/user-guide/connected-mode#smart-notifications "mention") make you aware of changes made on the server. Finally, select **Finish** to complete the Connection wizard.

SonarQube for Eclipse will automatically compare SonarQube Server’s project list against open projects in your workspace. If you’ve accepted notifications, SonarQube for Eclipse will suggest a binding. The final step involves binding your local project to the project on the server.

Note that logging in with your **Username** + **Password** was available in previous versions of SonarQube for Eclipse to create a connection setup with SonarQube Server. If you used this method in a previous version and then updated SonarQube for Eclipse, you will need to reauthenticate your connection by adding a *user token*.
{% endtab %}

{% tab title="SONARQUBE CLOUD US REGION" %}
If your SonarQube Cloud organization is in the US region, complete these steps *before* starting the connected mode setup:

#### **Enable the US region option in your IDE**

1. In Eclipse, go to **Window** > **Preferences** > **SonarQube** (or **Eclipse** > **Settings… > SonarQube** for Mac OS).
2. Select the **Show region selection for SonarQube Cloud (Early Access)** option.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2FRrxm2c6ahKY3ynVfjb2J%2Fc899dd459defb8e89f103a0c7f88b316a10ec144.png?alt=media&#x26;token=458ed03a-4f35-4ef2-abe8-2c5e9eb70cab" alt="To set up connected mode with an account in the US region, you need to update a setting in SonarQube for Eclipse." width="375"><figcaption></figcaption></figure></div>

#### **Connect the SonarQube Cloud US organization to your IDE**

Follow the procedure described in [#create-a-new-sonarqube-cloud-connection](#create-a-new-sonarqube-cloud-connection "mention") by selecting your region, provide your **User Token**, select your **Organization,** and specifying a **Connection Name**.

Be sure to select the **US - sonarqube.us** option as illustrated below (the EU option is selected by default).

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2FPrUsASzqBPwPkX4UEyMw%2Ff73ff18d2a8f950541662ac44ccbe312a488f86f.png?alt=media&#x26;token=a2a8e57f-5a7c-485f-8477-986b36cf6ec8" alt="If you have already enabled the US region option in your IDE, you will see the option to choose US - sonarqube.us when creating a new connected mode connection to SonarQube Cloud." width="375"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="SONARQUBE CLOUD" %}

#### **Automatic setup with SonarQube Cloud**

SonarQube Cloud offers the easiest way to set up connected mode: simply use the **Open in IDE** feature from SonarQube Cloud (see [#opening-issues-in-the-ide](https://docs.sonarsource.com/sonarqube-for-eclipse/using/investigating-issues#opening-issues-in-the-ide "mention")). You must trust the SonarQube Cloud 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-connected-mode-setup](https://docs.sonarsource.com/sonarqube-for-eclipse/resources/troubleshooting#troubleshooting-connected-mode-setup "mention") article if something doesn’t work right or follow the instructions below to manually create a SonarQube Cloud connection.

#### **Create a new SonarQube Cloud connection**

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2FqHyU7Xz1n5AQN6UelIy5%2Fsq-eclipse-select-eu-region.png?alt=media&#x26;token=5d57a3e5-13ac-4a33-b39d-29574534c54e" alt="Choose SonarQube Cloud, your region, and add your Token and Organization details to set up your connection with SonarQube for Eclipse." width="375"><figcaption></figcaption></figure></div>

1\. Select **SonarQube Cloud** and select **Next** to continue. Choose your region (the EU option is selected by default).

* If you're connecting to an organization in the US region, please review the [#sonarqube-cloud-us-region](#sonarqube-cloud-us-region "mention") tab for instructions to expose the setting.

2\. You will be prompted to add a User **Token** generated by SonarQube Cloud. If you don’t already have a token, selecting **Generate token** will open the `https://sonarcloud.io/account/security` page in your default browser; see the [Managing Personal Access Tokens](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/managing-your-account/managing-tokens "mention") page in SonarQube Cloud if needed. Select **Next** to continue.

{% hint style="warning" %}
*User tokens* are required when setting up connected mode or an MCP Server between SonarQube (Server, Cloud) and SonarQube for IDE. Note that the binding will not function properly if *project tokens*, *global tokens*, or *scoped organization tokens* are used during the setup process.
{% endhint %}

3\. Start typing the name of your SonarQube Cloud **Organization** and choose your organization from the filtered list that appears; your Organization Key will automatically populate the field. Select **Next** to continue.

* Your Organization Key can be found at any time by going to your SonarQube Cloud **Account** > **Organizations** page: `https://sonarcloud.io/account/organizations`. Keys for third-party organizations can be found by going to the project’s; see the [Retrieving projects](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/managing-your-projects/retrieving-projects "mention") page for more information.

4\. Enter a **Connection name** so that you can find it later in the **SonarQube Bindings** view window. Select **Next** to continue. **Connection Name** is a friendly name for your connections.

5\. Then, choose if you want to receive Notifications; you have the option to allow [SonarQube for IDE #Smart notifications](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/analyzing-source-code/connected-mode#smart-notifications "mention") to send Smart Notifications to the IDE. Smart notifications inform you of changes made on the server. Finally, select **Finish** to complete the Connection wizard.

SonarQube for Eclipse will automatically compare the SonarQube Cloud organization’s project list against open projects in your workspace. If you’ve accepted notifications, SonarQube for Eclipse will suggest a binding. The final steps involve binding your local project to the project on the server.
{% endtab %}
{% endtabs %}

## First-time connection setup for shared binding <a href="#first-time-connection-setup-for-shared-binding" id="first-time-connection-setup-for-shared-binding"></a>

One team member must step through the first-time setup process, then export and commit the binding configuration to the repository. Any team member who opens the project while running SonarQube for IDE will automatically receive a notification to bind the project. Each team member must use their own project credentials and SonarQube for IDE will use the binding details found in the configuration file to complete the connection.

To begin, one person from the team must follow the steps outlined in **Using the connection wizard** and **Configure your binding**, then follow the **Save and share your setup** instructions below to save the project configuration for the rest of the team.

<details>

<summary>Using the connection wizard</summary>

**Connected mode setup**

Follow the [#connection-setup](#connection-setup "mention") instructions above for your SonarQube (Server, Cloud) connection.

</details>

<details>

<summary>Configure your binding</summary>

**Bind your project**

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 remote server in the **SonarQube 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.

You will receive a notification that the binding is successful.

Lastly, follow the [#save-and-share-your-setup-recommended-for-teams](#save-and-share-your-setup-recommended-for-teams "mention") instructions below to save the project configuration for the rest of the team.

</details>

<details>

<summary>Save and share your setup: Recommended for teams</summary>

**Reuse the binding configuration**

**Export the binding configuration**

There are two ways to create a binding configuration file:

1. Right-click on a connection found in the **SonarQube Bindings** view and select ![-](https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-c3b7c887782aa76ef39bb98a62cc1187d82e2a4c%2F640aee2e3cb57d3c3e730dd99b8acf1d42d4fd41.png?alt=media) **Share Binding…**.
2. Right-click on a project in the Eclipse Explorer, then navigate to **SonarQube** and select ![-](https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-c3b7c887782aa76ef39bb98a62cc1187d82e2a4c%2F640aee2e3cb57d3c3e730dd99b8acf1d42d4fd41.png?alt=media) **Share Binding…**.

Either method prompts a confirmation window to explain that a configuration file will be created. Once confirmed, a .json file containing the SonarQube Server URI and Project Key or SonarQube Cloud Organization and Project Key will be added to the .sonarlint folder in your project.

**Export binding configurations for a hierarchical directory**

SonarQube for Eclipse gives you the ability to export shared binding configurations to match hierarchical project directories.

* If you right-click on the parent-level project and select **Share Binding…**,
  * the binding configuration file will be saved at the root project level.
* If you right-click on a child-level project and select **Share Binding…**,
  * choose **Save to Project** to create a binding configuration file at the child level or,
  * choose **Save to Root Project** to create a binding configuration file at the parent level.

**Share the binding configuration**

Commit the file you just created in the working directory; your teammates should have access to the binding configuration once your commit becomes part of the repository.

Because your Project’s identifying information is saved in a location under source control, it will be available to anyone with access to the project repo. Each team member is still required to have their own SonarQube (Server, Cloud) credentials; these are managed in

* See the [Managing your tokens](https://app.gitbook.com/s/LWhbesChsC4Yd1BbhHhS/user-guide/managing-tokens "mention") page in SonarQube Server.
* See the [Managing Personal Access Tokens](https://app.gitbook.com/s/B4UT2GNiZKjtxFtcFAL7/managing-your-account/managing-tokens "mention") page in SonarQube Cloud.

Each team member is still required to have their own SonarQube Server or SonarQube Cloud connection and credentials.

</details>

## Bind using shared configuration <a href="#bind-using-shared-configuration" id="bind-using-shared-configuration"></a>

When opening or adding a new project to the Eclipse Explorer, SonarQube for Eclipse will check for a shared binding configuration file and promptly notify users.

If no connection exists, SonarQube for Eclipse will ask to create a new connection. Users must provide their own User Token in the connection mode setup wizard; selecting the **Generate token** button will open SonarQube (Server, Cloud) to step through this process and populate the setup form with your new token.

If a matching connection setup exists, users are asked only to bind the project using the shared binding configuration.

### Bind configurations for hierarchical directories <a href="#bind-configurations-for-hierarchical-directories" id="bind-configurations-for-hierarchical-directories"></a>

Because Eclipse can have multiple local projects open in the Eclipse Explorer, SonarQube for Eclipse might find multiple shared binding configuration files. When there are multiple combinations, SonarQube for Eclipse will suggest the best match between the local projects and those on the server.

To confirm the project bindings, select the **More information** link in the notification window to check how SonarQube for Eclipse will map the configuration. If the suggested matches are incorrect, you must configure or reconfigure the bindings manually.

### Sharing configurations between different IDEs <a href="#sharing-configurations-between-different-ides" id="sharing-configurations-between-different-ides"></a>

SonarQube for IDE extensions are available for IntelliJ (and other JetBrains IDEs), Visual Studio, VS Code, and Eclipse. Although the information stored in the shared configuration file is the same, each extension *might export the JSON file to a slightly different location* depending on IDE and project type. This may cause friction when opening a configuration in an IDE other than the IDE that created it.

If SonarQube for IDE does not send you a notification to accept a shared configuration, please check first if you have opened your project’s root. If SonarQube for IDE still does not suggest a matching configuration, you must configure binding manually. Please see the **Configure your binding** collapsible above for instructions.

## Project binding <a href="#project-binding" id="project-binding"></a>

SonarQube for IDE keeps server-side data in local storage and synchronizes with configured servers at startup; one example would be the quality profile defined by your SonarQube Cloud Organization.

A binding update will automatically be attempted once every hour or after an IDE restart and SonarQube for IDE will do its best to synchronize with the most appropriate branch from the server.

### View connections <a href="#view-connections" id="view-connections"></a>

Connections and their bindings can be retrieved in the **SonarQube Bindings** view tab which is found by navigating to the **File Menu** > **Window** > **Show View** > **Other…** > **SonarQube** > **SonarQube 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.

<div align="left"><figure><img src="https://231328848-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkadXEH8HkykK7lKaDvVq%2Fuploads%2Fgit-blob-6230e6a05859d7527a74ce1b13564b0e32f566ca%2F3656765d11015b677455d8ef8644891f38186c55.png?alt=media" alt="You can view and manage your connections and bindings in the SonarQube Bindings view." width="563"><figcaption></figcaption></figure></div>

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

## SonarQube for IDE-SonarQube Server version support policy <a href="#sonarlint-sonarqube-version-support-policy" id="sonarlint-sonarqube-version-support-policy"></a>

SonarQube for IDE enables users to establish a connection to the latest SonarQube Server version and to the latest LTA (Long-Term Active) version. When a new LTA version is released, we still enable connecting SonarQube for IDE to the previous LTA version for a certain period of time (currently 9 months after the latest LTA release) to allow enough time for organizations to update their SonarQube Server version.

For more information about long-term support of SonarQube Server, check out our page describing the SonarQube Server [Release cycle model](https://app.gitbook.com/s/LWhbesChsC4Yd1BbhHhS/server-update-and-maintenance/update/release-cycle-model "mention"). Review your SonarQube for IDE-specific requirements for version-to-version differences.

{% hint style="warning" %}
*The 8.9LTA reached its support expiration date (in November ’23)*.
{% endhint %}

## Learn more <a href="#learn-more" id="learn-more"></a>

Check out the main [connected-mode](https://docs.sonarsource.com/sonarqube-for-eclipse/connect-your-ide/connected-mode "mention") page to learn more about the benefits of using connected mode, information about SonarQube for Eclipse’s branch matching strategy, and how to activate and deactivate your Sonar Smart Notifications in the IDE.
