【发布时间】: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