How do I run the sonar-custom-plugin-example?

207 views
Skip to first unread message

prince...@gmail.com

unread,
May 18, 2017, 9:39:16 AM5/18/17
to SonarQube
Hello all,

Sorry if this sounds stupid.

I have successfully built the custom plugin and deployed it on my local server. Server logs show it has been deployed. Now what? How do I trigger this plugin to run with sonar scanner? I tried scanning a sample C++ project, but all I see are the results from the sonar-cxx plugin.

Regards,
Prince

G. Ann Campbell

unread,
May 18, 2017, 10:04:15 AM5/18/17
to SonarQube, prince...@gmail.com
Hi Prince,

What kind of plugin are we talking about? New rules? New metrics? New interface options?


Ann

Prince Samuel

unread,
May 18, 2017, 10:13:31 AM5/18/17
to G. Ann Campbell, SonarQube
Ann,

I just used the unmodified custom plugin example from Github (https://github.com/SonarSource/sonar-custom-plugin-example). Is that going to be triggered only if it sees a file with the Foo fictional language? How do I say that the new rules from this plugin should be aways run?

Anyway, I want to be able to run a custom lint output parser (just like https://github.com/SonarSource/sonar-custom-plugin-example/blob/master/src/main/java/org/sonarsource/plugins/example/rules/FooLintIssuesLoaderSensor.java) by creating my own plugin and then running it via sonar-scanner.

Regards,
Prince

Julien HENRY

unread,
May 29, 2017, 3:29:58 PM5/29/17
to SonarQube, ann.ca...@sonarsource.com, prince...@gmail.com
Hi Prince,

The custom plugin sample declare a new language "Foo" that will consider all files having the ".foo" suffix:

So first of all you have to create some *.foo files in your source directory. This should be enough to have the file content imported in SonarQube.

++

Julien
Reply all
Reply to author
Forward
0 new messages