:https://github.com/Pablissimo/SonarTsPluginsonarqube打字稿插件:「您必須安裝支持該語言插件」我試圖建立SonarQube使用這個插件來分析我的打字稿項目
不過,我遇到一個錯誤,如:
> C:\sonarqube\sonar-runner-2.4\bin\sonar-runner.bat
...
INFO:
------------------------------------------------------------------------
INFO: EXECUTION FAILURE
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:
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.
我的設置: - Windows 7的64位 - JDK8(1.8.0)64位 - SonarQube 5.1 64位
我已經建立了從源代碼插件,並複製產生.jar文件到我的SonarQube安裝C:\sonarqube\sonarqube-5.1\extensions\plugins\sonar-typescript-plugin-0.1-SNAPSHOT.jar
。
SonarQube正在運行並服務於端口9000,我可以在設置 - >系統 - >更新中心看到TypeScript插件已安裝,語言關鍵字爲typescript
。
基於this post,看來我必須:
登錄到你的聲納實例,單擊「設置」>「質量概況」和你想要的語言標題的頂部「創建」使用。
看着這些設置,我看到一個Typescript Profiles
標題,以定義並設置爲默認值的TsLint
輪廓。
最後,在我的項目的根目錄下,我有一個文件sonar-project.properties
# Required metadata
sonar.projectKey=my-ts-project
sonar.projectName=A TypeScript Project
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=src
# Language
sonar.language=typescript
# Encoding of the source files
sonar.sourceEncoding=UTF-8
有了所有這些配置,我還收到了聲納亞軍錯誤「您必須安裝支持該語言插件」 。
我錯過了什麼?
編輯:
我嘗試安裝了JavaScript的插件,和我看到了同樣的問題。所以這不僅限於TypeScript。我可以針對Java項目運行Sonar,但沒有其他語言似乎能夠工作。