Sonarqube 分析声纳项目时出错

Sonarqube 分析声纳项目时出错,sonarqube,metrics,code-metrics,sonar-runner,Sonarqube,Metrics,Code Metrics,Sonar Runner,嗨,我有一个自定义的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.") }) publi

嗨,我有一个自定义的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以上的所有版本上都是一致的。 但是,如果我将属性文件中的language值更改为java,项目将像以前一样进行分析

sonar.language=java
此操作正常时,属性文件的编程值错误,甚至在显式指定语言名称的情况下运行作业后操作:

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

为了让我的项目为我的RPG插件执行RPG project,我还需要做其他事情吗?

问题来自于没有为RPG语言定义的规则库(甚至是空的),所以Sonar认为不支持这种语言

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