【问题标题】:Error while analyzing sonar project分析声纳项目时出错
【发布时间】:2013-04-23 04:48:25
【问题描述】:

您好,我有一个用于 RPG 的自定义声纳插件,并且正在尝试运行一个声纳项目。 这是我的插件类:

@Properties({
@Property(key = "rpg", defaultValue = "rpg", name = "File suffixes",
    description = "Comma-separated list of suffixes for files to analyze. To not filter, leave the list empty.")
})

public class RPGPlugin extends SonarPlugin {
 ...

在我要运行分析的项目中,我有以下 sonarproject.properties 文件:

#These are the required metadata for any sonar project
sonar.projectName= prj1
sonar.projectKey = prj1
sonar.projectVersion = 0.1
# The value of the property must be the key of the language.
sonar.language=rpg
#Path to source directory
sources = src

这种方法在 Sonar 3.2 之前可以正常工作,但之后就失败了。现在通过 sonar runner 完成的分析显示以下错误:

Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException: 
You must install a plugin that supports the language 'rpg'

此错误在 3.2 以上的所有版本上都是一致的。 但是,如果我将属性文件中的语言值更改为java,项目分析和以前一样

sonar.language=java

虽然这有效,但属性文件的编程值错误,甚至会运行明确指定语言名称的 post job 操作:

public boolean shouldExecuteOnProject(Project project) {
    return "rpg".equalsIgnoreCase(project.getLanguageKey());

为了让我的项目为我的 RPG 插件执行 RPG 项目,我还需要做些什么吗?

【问题讨论】:

    标签: sonarqube metrics code-metrics sonar-runner


    【解决方案1】:

    问题在于没有为 RPG 语言定义规则库(甚至是空的),因此 Sonar 认为该语言不受支持。

    更一般地说,在添加对新语言的支持时,对您来说最好的选择是查看我们为 Sonar 开发的一些开源语言插件。比如你可以去看看the Javascript plugin。

    【讨论】:

      猜你喜欢
      • 2016-03-21
      • 2017-05-09
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 2020-10-04
      • 1970-01-01
      • 1970-01-01
      • 2013-01-13
      相关资源
      最近更新 更多