laffoyb laffoyb - 1 year ago 215
TypeScript Question

sonarqube typescript plugin: "You must install a plugin that supports the language"

I'm trying to setup SonarQube to analyse my TypeScript project using this plugin:

However, I'm encountering an error like:

> C:\sonarqube\sonar-runner-2.4\bin\sonar-runner.bat
INFO: ------------------------------------------------------------------------
Total time: 3.006s
Final Memory: 18M/613M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must install a plugin that supports the language 'typescript'
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

My setup:
- Windows 7 64 bit
- JDK8 (1.8.0) 64 bit
- SonarQube 5.1 64 bit

I've built the plugin from source, and copied the resulting .jar file to my SonarQube installation at

SonarQube is running and serving to port 9000, and I can see at Settings->System->UpdateCenter that the TypeScript plugin is installed, with language keyword

Based on this post, it seems I must:

Login to your Sonar instance, click on "Settings" > "Quality profiles" and "Create" on top of the heading for the language you want to use.

Looking at those settings, I see a
Typescript Profiles
heading, with a
profile defined and set to Default.

Finally, in my project root directory, I have a file

# Required metadata
sonar.projectName=A TypeScript Project

# Comma-separated paths to directories with sources (required)

# Language

# Encoding of the source files

With all this configuration in place, I still receive the sonar-runner error "You must install a plugin that supports the language".

What am I missing?


I tried installing the JavaScript plugin, and I'm seeing the same problem. So this isn't limited to TypeScript. I can run Sonar against Java projects, but no other languages seem to work.

Answer Source

Okay, I figured out how to solve this specific problem. The key sonar.language in my should be set to ts, not typescript.

# Language

I figured this out by looking at example project corresponding to the javascript plugin: Here, the language is set to js not javascript.

I have to guess that, in general, the language key should be set to the normal file extension for source files? i.e. Java -> .java, JavaScript -> .js, TypeScript -> .ts ... If so, well that's not obvious. Is there any way to confirm this hunch?