A Sonarqube plugin for Jeka
Just declare the plugin in your build class.
@JkDefClasspath("dev.jeka.plugins:sonarqube:[version]")
public class Build extends JkClass {
JkPluginJava javaPlugin = getPlugin(JkPluginJava.class);
JkPluginSonarqube sonarqube = getPlugin(JkPluginSonarqube.class);
...
}
Execute run
method from Sonaqube plugin after a build as jeka clean java#pack sonarqube#run
.
Sonarqube client can be configured programmatically using sonarqube
instance and/or
using standard system properties from the command line as -Dsonar.host.url=...
(see https://docs.sonarqube.org/latest/analysis/analysis-parameters/).
You can use directly JkSonarqube
in build code without using JkPluginSonarqube
class.
You can invoke Sonarqube plugin from command line on a Jeka project that does declare this plugin it.
jeka java#pack @dev.jeka.plugins:sonarqube:[version] sonarqube#run
It can be used in conjunction of Jacoco
jeka java#pack @dev.jeka.plugins:jacoco:[version] jacoco# @dev.jeka.plugins:sonarqube:[version] sonarqube#run
jeka sonarqube#help
or jeka @dev.jeka.plugins:sonarqube:[version] sonarqube#help
See example here
This project uses Jeka wrapper, you don't need to have Jeka installed on your machine. simply execute ./jekaw cleanPack
from the root of this project.