Warning message to GUI from custom plugin

Hi, I would like to add some analysis error notification / warning to the gui if something happened during the analysis.

On GUI I know there is a “Last analysis had x warning” section, but is it available for the public to add custom warning from plugin side?

I know I could create a custom error rule, but would like to use the GUI properly if I can.

Thanks in advance.

Hi,

You can use AnalysisWarnings. See how to use it on scanner side:

++

Thanks, I think this would be it. But how could I use it? I mean I have access to the context, sensorcontext but Iam not sure where should I get the AnalysisWarning from.

SonarQube plugins are loaded into PicoContainer, that is an IoC framework. Just add it as parameter to your Sensor constructor.

Yeah, just managed to do this as You wrote it :slight_smile:

Thanks for the help.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.