# Teamscale Integration for Eclipse

Before installing the Teamscale Integration for Eclipse, make sure its system requirements are met.

# Installing the Plug-in

Depending on your needs, there are several options to install the Teamscale Integration for Eclipse.

For most users, installing the latest version of the plug-in from the Eclipse Marketplace (opens new window) is recommended.

  1. Open the Teamscale Integration for Eclipse solution page (opens new window) at the Eclipse Marketplace.
  2. Drag the Install button from the solution page onto your running Eclipse workspace. This opens the installation wizard.
  3. Follow the instructions of the installation wizard
  4. Restart Eclipse when prompted.

# Installing Any Version From the CQSE Website

Unlike the Eclipse Marketplace, the CQSE website offers both the latest version and older versions of the plug-in.

  1. Select Help > Install New Software... from the Eclipse menu bar.
  2. Enter a Work with location.
    • Latest Version: https://www.cqse.eu/download/teamscale/ide/eclipse/latest/
    • Older Version: https://www.cqse.eu/download/teamscale/ide/eclipse/vM.N.x/ (replacing M.N by the feature version you need but keeping the .x, e.g., 7.8.x)
  3. Select Teamscale Integration for Eclipse and any optional features you want.
  4. Click Next and follow the instructions of the installation wizard.
  5. Restart Eclipse when prompted.

# Installing While Offline

In case you cannot reach the Eclipse Marketplace or CQSE Website during the installation, e.g., due to a security policy, you can perform an offline installation.

  1. Download an archive of the update site from the CQSE website.
  2. Transfer the downloaded archive to your offline computer.
  3. Select Help > Install New Software... from the Eclipse menu bar.
  4. Click Add and the Archive.
  5. Select the downloaded archive.
  6. Select Teamscale Integration for Eclipse and any optional features you want.
  7. Click Next and follow the instructions of the installation wizard.
  8. Restart Eclipse when prompted.

Installing on the Command Line

You can perform the offline installation on the command line as well.

  1. Unzip the downloaded archive.
  2. Use the Eclipse p2 director (opens new window) to install.
    eclipse -nosplash -application org.eclipse.equinox.p2.director -repository file:///path/to/teamscale-eclipse-update-site -installIU com.teamscale.ide
  3. (If you ever need to uninstall the plug-in, you can use the p2 director as well.)
    eclipse -nosplash -application org.eclipse.equinox.p2.director -uninstallIU com.teamscale.ide

Don't Use Eclipse's Dropins Mechanism

With the dropins (opens new window) folder, Eclipse provides another way of installing plug-ins. We (and the Eclipse team) discourage using it for installing plug-ins unless you absolutely need to. You won't get error messages with the dropins mechanism as you would with the p2 director, e.g., in case of missing dependencies.

# Connecting to Teamscale

After installing the plug-in, you can configure a Teamscale server via the following steps:

  1. Open the Eclipse preferences dialog, navigate to the Teamscale settings (Window > Preferences... > Teamscale) and click on Add
  2. Enter a descriptive name and the URL of the Teamscale server
  3. Enter your Username and IDE Access Key Eclipse Server Settings
  4. Test the connection by clicking on Validate.
  5. Close the dialog by pressing OK.

# Enabling the Plugin for Eclipse Project(s)

To connect an Eclipse project to Teamscale and obtain quality data such as findings, perform the following steps:

  1. Open the project properties by right-clicking on the project and selecting Properties.
  2. On the left side, switch to the Teamscale entry.
  3. Click on Enable Teamscale for this project and select the appropriate server.
  4. Click on Automatically configure Teamscale which will automatically identify the correct mapping to the code in Teamscale. Teamscale Project Properties in Eclipse

After connecting a project to Teamscale you can enable the display of findings in the menu bar via Teamscale > Load findings for open files.

# Performing Pre-commit Analysis

The Eclipse plug-in can be used to analyze changes prior to committing them to the repository. This functionality is called pre-commit analysis. Only the files changed since the last commit that is present on the Teamscale server are uploaded and analyzed by pre-commit analysis. To compute this delta, Teamscale connects to the version control system configured for the IDE projects. Currently, supported version-control systems are Git and Subversion (using Subversive (opens new window) or Subclipse (opens new window)) You can trigger the pre-commit analysis by selecting Teamscale > Upload Projects for Pre-Commit Analysis from the Eclipse main menu or via the shortcut »Ctrl+9«.

Eclipse reports the findings delta after a few seconds in a balloon as shown in this screenshot and in the Pre-Commit Results view: Pre-commit Analysis Findings Delta

The new findings are also shown in the complete findings list as shown on the left side in the screenshot, however, the Pre-Commit Results view allows you to focus on the new findings.

Under the hood, Teamscale handles the pre-commit upload as if it would be a new branch in the repository. After the upload, Teamscale shows findings from this virtual branch. To show findings from real repository branches again (e.g., after you switched to a different branch), disable the Show Findings from Pre-Commit Branch toggle in the Teamscale menu.

Note that, by default, Teamscale enforces some limits to such a pre-commit upload. These limits exist so that one overly large pre-commit upload does not disproportionately delay other analyses of other commits, whether pre-commits by other users or regular. For example, pre-commit only works if your local branch is not too far ahead of what your Teamscale server has already seen and analyzed. More information is available here .