Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Can you run sonarqube on a regular maven goal?


Asked by Angie Thomas on Dec 12, 2021 Maven



The ability to execute the SonarQube analysis via a regular Maven goal makes it available anywhere Maven is available (developer build, CI server, etc.), without the need to manually download, setup, and maintain a SonarQube Runner installation.
Besides,
Sonar runner is usually executed as a maven plugin but Jenkins can invoke it without the need of maven through the Execute SonarQube Scanner task. Navigate to Manage Jenkins -> Manage Plugins` and ensure that the latest version of SonarQube plugin is installed.
Similarly, SonarScanner for Maven. The SonarScanner is recommended as the default analyzer for Maven projects. The ability to execute the SonarQube analysis via a regular Maven goal makes it available anywhere Maven is available (developer build, CI server, etc.), without the need to manually download, setup, and maintain a SonarQube Runner installation.
Keeping this in consideration,
Before we go any further, Let’s understand What SonarQube (previously known as Sonar) is?SonarQube is open-source for continuous inspection of code quality. Sonar is a web based code quality analysis tool for MAVEN based JAVA projects.
Accordingly,
There is no need to configure more in the pom.xml, unless you want to exclude individual classes or tests from the mutation analysis. More about that can be found in the plugin documentation. Now that the reports are in a machine-readable format, SonarQube needs to be configured so it can also use the data.