- versions used : 8.9.1 LTS (scanner : sonar-maven-plugin:3.9.0.2155)
- error observed :
We have developed a custom server-side plugin which exposes a endpoint and query sonarqube services (nothing else). It is declared like this :
@ServerSide
public class PrometheusWebService implements WebService {
and it’s added to the plugin class like this :
public class PrometheusExporterPlugin implements Plugin {
@Override
/**
* Define settings and main class for plugin.
*/
public void define(Context context) {
(...)
context.addExtension(PrometheusWebService.class);
}
When an analysis is launched, this plugin is downloaded on the scanner although it has no “scanner-side” component, and it may crash the analysis since the plugin is compiled with java 11 target and the scanner may be running with java 8.
I can see other metrics plugins around here which target java 11 and don’t have this problem : sonar-generic-metrics/pom.xml at master · ericlemes/sonar-generic-metrics · GitHub
Am I missing something to declare a full server-side plugin ? Or is this a buggy behavior of the scanner or the server ? (we have full control on the scanners so we can upgrade all of them if necessary).