Reputation: 1517
Hi I have a custom sonar plugin for RPG and am having a sonar project that I am trying to run. Here's my plugin class:
@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 {
...
In the project where I want to run the analysis, I have the following sonarproject.properties file:
#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
This approach worked correctly till Sonar 3.2 but failed thereafter. Now the analysis done via sonar runner shows the following error:
Exception in thread "main" org.sonar.batch.bootstrapper.BootstrapException: org.sonar.api.utils.SonarException:
You must install a plugin that supports the language 'rpg'
This error is consistent on all versions above 3.2. However, if I change the value of language in property file to java, the project analyses as before
sonar.language=java
While this is working, the property file has wrong programming value and even runs the post job action where the language name is explicitly specified:
public boolean shouldExecuteOnProject(Project project) {
return "rpg".equalsIgnoreCase(project.getLanguageKey());
Is there any other thing that I need to do in order to let my project execute RPG project for my RPG plugin?
Upvotes: 0
Views: 577
Reputation: 26843
The problem comes from the fact that there's no defined rule repository (even an empty one) for the RPG language, so Sonar thinks that this language is not supported.
More generally, when adding support for a new language, the best option for you is to take a look at some open-source language plugins that we develop for Sonar. For instance, you can go and see the Javascript plugin.
Upvotes: 1