2013-04-29 61 views
0

嗨,我有一个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 

这种方法工作正常,直到声纳3.2,但此后未能。现在通过声纳亚军完成的分析显示以下错误:

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 

虽然这是工作中,特性文件​​有错误的程序价值,甚至运行后作业操作这种语言名字是明确指出:

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

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

回答

1

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

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