1

我对 Sonar 非常陌生,并且正在设置我的第一个服务器/项目。

环境:

  • 操作系统:Windows Server 2008 R2 / amd64 / 6.1
  • 应用服务器:Tomcat/7.0.40I,部署了 Sonar WAR 文件(3.5.1)。
  • 数据库:MySQL 5.6.11

(相关)插件:

  • Sonar C++ 社区插件 (0.2)

该插件在 General Settings --> Sonar C++ Community Plugin 下可见

声纳-project.properties

# Required metadata
sonar.projectKey=test:pmc
sonar.projectName=PMC
sonar.projectVersion=1.0
sonar.language=c++

# Comma-separated paths to directories with sources (required)
sonar.sources=c:/SVN/Development/test/PMC/trunk/AppServer,c:/SVN/Development/test/PMC/trunk/PmcShared,c:/SVN/Development/test/PMC/trunk/WebServer,c:/SVN/Development/test/PMC/trunk/Tools

# Optional path to the CppCheck program required to activate some CppCheck rules
sonar.cpp.cppcheck.path=C:/Program Files (x86)/Cppcheck/cppcheck.exe

# Encoding of the source files
sonar.sourceEncoding=UTF-8

我不明白的是它找不到支持'cxx'语言的插件:

C:\Users\Administrator\Documents\sonar-projects\PMC>sonar-runner
C:\Users\Administrator\Documents\sonar-runner-2.2.1
Sonar Runner 2.2.1
Java 1.7.0_21 Oracle Corporation (64-bit)
Windows Server 2008 R2 6.1 amd64
INFO: Runner configuration file: C:\Users\Administrator\Documents\sonar-runner-2.2.1\conf\sonar-runner.properties
INFO: Project configuration file: C:\Users\Administrator\Documents\sonar-projects\PMC\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Users\Administrator\Documents\sonar-projects\PMC\.sonar
INFO: Sonar Server 3.5.1
15:20:54.231 INFO  - Load batch settings
15:20:54.794 INFO  - User cache: C:\Users\Administrator\.sonar\cache
15:20:54.797 INFO  - Install plugins
15:20:55.742 INFO  - -------------  Executing Project Scan
15:20:56.482 INFO  - Install JDBC driver
15:20:56.487 INFO  - Apply project exclusions
15:20:56.493 INFO  - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
15:20:56.771 INFO  - Initializing Hibernate
15:20:59.229 INFO  - -------------  Inspecting PMC
15:20:59.229 INFO  - Load module settings
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 6.162s
Final Memory: 13M/221M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must install a plugin that supports the language 'cxx'
ERROR:
ERROR: To see the full stack trace of the errors, re-run Sonar Runner with the -e switch.
ERROR: Re-run Sonar Runner using the -X switch to enable full debug logging.

我确实安装了声纳 C++ 社区插件,所以我想我错过了明显的......有人可以帮我入门吗?

4

4 回答 4

1

看来我在配置文件中犯了一个错误。我重新创建了它,现在工作运行了!此问题已关闭,上述配置将起作用。

于 2013-05-29T07:26:43.260 回答
1

我在使用 C# 插件时遇到了类似的错误: 错误:原因:您必须安装支持语言“cs”的插件, 请备注“cs” 很长时间后,我发现“cs”后面有多余的“”。删除配置文件中的额外空间时,它起作用了。似乎声纳跑步者不使用“修剪”。

于 2013-06-19T12:18:18.063 回答
0

要查找激活任何给定 SonarQube 语言插件所需的字符串,请转到“设置”->“系统”->“更新中心”。对于每个插件,短名称将在人类可读名称右侧的方括号中。

C / C++ / Objective-C [cpp]

在此示例中,“cpp”是要在 sonar-project.properties 中的 sonar.language 属性中使用的名称。

于 2015-04-09T20:45:23.980 回答
0

对于新用户,如果您仍然收到此错误(SonarQube 4+)启动服务器,请转到“设置”(右上角)然后搜索“更新中心”,在那里添加缺少的模块,然后重新启动服务器。它应该可以工作来源:来自官方项目网站的链接

于 2015-02-14T18:28:06.223 回答