Questions tagged [sonar-maven-plugin]

SonarQube™ is an open source platform for Continuous Inspection of code quality. The Maven Plugin triggers the code analyzers.

From SonarQube / Documentation / Documentation / … / Analyzing with Maven

Analyzing a Maven project consists of running a Maven goal: sonar:sonar in the directory where the pom.xml file sits.

The Maven Plugin triggers the code analyzers.

40 questions
18
votes
3 answers

Sonar maven plugin: same project key for all modules does not work?

I am using sonar-maven-plugin 3.2 and maven 3.3.9. In the parent POM, I have the sonar.projectKey maven property defined. The value is in effect, I can see it from the printout of sonar. But the mvn sonar:sonar step fails, because the maven modules…
McH
  • 203
  • 1
  • 2
  • 4
7
votes
4 answers

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar error

My Java project written and compiled in 1.8 through Maven. I am getting the following error when I try to analyze my code using sonar-maven-plugin Ver. 3.9.1.2184 for SonarQube 9.2.4. The following parameters are…
Subhasis Basu
  • 71
  • 1
  • 1
  • 2
6
votes
1 answer

Sonar maven analysis - class not found

I'm trying to setup SonarQube (v.4.5.6) with maven support. I believe my configuration is correct but I can't get SonarQube analysis to run without errors. My project's dependencies:
resilva87
  • 3,325
  • 5
  • 32
  • 43
6
votes
6 answers

sonar maven plugin build error, SonarQube version: null

My jenkins builds just started to fail with this message: [INFO] --- sonar-maven-plugin:2.7:sonar (default-cli) @ cividas-core-web --- [INFO] artifact com.ontimize:ontimize-core: checking for updates from central [INFO] artifact…
NotGaeL
  • 8,344
  • 5
  • 40
  • 70
5
votes
2 answers

Automatically associate new Sonar project with custom quality profile and quality gate

Our use case for Sonar creates new Sonar projects for each branch of our repository. How do we automatically associate the new branch project with a (non-default) Quality Profile and Quality Gate? We're running this in a Maven project if that's…
Mzzzzzz
  • 4,770
  • 7
  • 30
  • 47
5
votes
2 answers

Sonar reports different line and branch coverage than Idea, Eclipse, Maven and Jenkins

I have all those tools reporting the same coverage with JaCoCo: 69% line coverage and 23% branch coverage. Note: Screenshots had been taken over several days so they have slightly different values, but the variance is <…
Jakub Bochenski
  • 3,113
  • 4
  • 33
  • 61
5
votes
0 answers

Maven Build Issues : Reading jacoco.exec file

We have several different faults with our jacoco.exec file, see the Error types below. Can you please help us with this problem, we have at least 25% build failures due to Jacoco. Error Type 1: 09:18:17 [INFO]…
4
votes
1 answer

Map in a serializable class is shown as Sonar violation when explicitly initialized with null

I am using SonarQube 6.7.3 with Sonar java plugin 5.3 I have a Serializable java class with a map as an instance variable. 1. Map is showing S1948 rule violation when initialized with null explicitly. 2. Map is not showing any violation when that…
arkay
  • 149
  • 1
  • 12
4
votes
1 answer

${session.executionRootDirectory} is not recognized by sonar-maven-plugin

I have several levels of nested Maven projects, where every module can participate in the global integration tests. To have a global, multi module coverage, I've configured jacoco to use and share the same file accross modules, using the Maven…
spi
  • 626
  • 4
  • 19
3
votes
0 answers

How can I configure sonar-maven-plugin to accept Java 9 module-info.java files?

How can I configure sonar-maven-plugin in my parent pom to accept (or ignore) Java 9 module-info.java files? After adding module-info.java files to my Maven multi module project our mvn sonar:sonar executions started failing. After reading about…
matsev
  • 32,104
  • 16
  • 121
  • 156
3
votes
1 answer

Sonar failed with an API incompatibility for Absent Code attribute

One of my fellow developers created a new application the other day and now I can't get a good Sonar compile. I've tried a number of documented workarounds/solutions to this sort of Absent Code error, but haven't found the right combination. The…
Sinc
  • 553
  • 1
  • 8
  • 31
2
votes
1 answer

surefire plugin output: "WARNING: An illegal reflective access operation has occurred"

I have the following plugins configured in my maven build: org.codehaus.mojo sonar-maven-plugin 2.6
2
votes
2 answers

SonarQube define "Ignore Issues on Multiple Criteria" in maven build

Is it supported by sonar-maven-plugin to set the "Ignore Issues on Multiple Criteria" to Narrow the focus as -Dsonar.issue.ignore.multicriteria for the sonar-maven-plugin run command? Any working example is welcomed.
Yuval Simhon
  • 1,439
  • 2
  • 19
  • 34
2
votes
2 answers

SonarQube: Bytecode of dependencies missing despite Maven usage

I use the sonar-maven-plugin version 3.4.0.905 to SonarQube-scan a flat hierarchy, multi-module Maven project. I have noticed a warning in the log of one of the 14 modules I scan. [WARNING] Bytecode of dependencies was not provided for analysis of …
A.H.
  • 31
  • 1
  • 5
2
votes
1 answer

what version of java is compatible sonar-maven-plugin

We are working on a existing project which should be compiled only in Java 6 version.We have sonar 4.5.7 to analyze the code quality.Now my question is the sonar-maven-plugin compatibility version which should work with Java 6. I have tried…
1
2 3