Can't find .jar files in Nexus for COBOL BuiltInQualityProfiles and RulesDefinition

My Custom Rules .java file for COBOL has the following import statements. I found org.sonar.api.plugin in my company’s NEXUS but not able to locate the other 2. Where can I get a copy.

I saw another post titled 'Error adding a sonarQube rules plug-in that directed user to SonarSource website for plugin sonar-cobol-plugin-4.0.0.2525.jar which also appeared in one of my JAVA compile error messages. How do I find it on that website?

import org.sonar.api.Plugin;

import org.sonar.api.server.profile.BuiltInQualityProfilesDefinition;

import org.sonar.api.server.rule.RulesDefinition;

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension)
  • how is SonarQube deployed: zip, Docker, Helm
  • what are you trying to achieve
  • what have you tried so far to achieve this

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey @Alan01777,

Thanks for reaching out.

org.sonar.api.Plugin, org.sonar.api.server.profile.BuiltInQualityProfilesDefinition and org.sonar.api.server.rule.RulesDefinition are all contained in the org.sonarsource.api.plugin:sonar-plugin-api artifact. This artifact should be resolvable by maven or gradle.

The sonar-cobol-plugin artifact itself can be found here.

I was able to run mvn clean install for the cobol example plugin after having copied the jar into the lib folder and updating the sonarcobol.version so it matched the downloaded cobol plugin version.

In case the above doesn’t help to solve your issue, what build system are you using to build the plugin? Also, did you start from an example plugin? If yes, which one?

Best,
Sebastian Zumbrunn

Unfortunately I am blocked and not in my Nexus Repo.

Hi @abradbard,

Could you try with the cobol-example-rules project in the custom rules plugin examples. Before compiling, you first have to copy the sonar-cobol plugin into the lib folder and update the sonarcobol.version property in the pom.xml to match the downloaded jar. Afterwards, running mvn clean install should work.

Best,
Sebastian

Thanks for your update.

I found a copy of sonar-cobol-plugin.jar in my .sonar folder on my c drive.
I used the jar xf command to get the version number.
I updated <sonar.cobol.plugin.version> in my pom.xml file
Should’t I also change the following to my project info?
cobol-custom-rules
COBOL Custom Rules Plugin
Custom SonarQube COBOL rules and quality profile.

For the tags artifactId,name,description

You can change those as well. The groupId can also be changed to something other than org.sonarsource.samples. mvn clean install should work either way.

Best,
Sebastian Zumbrunn