A.H.
A.H.

Reputation: 31

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 source files, you might end up with less precise results. Bytecode can be provided using sonar.java.libraries property

What could cause this issue? My understanding is that the sonar.java.libraries property only needs to be used when not using Maven. Am I mistaken? How can I best troubleshoot this issue?

Upvotes: 2

Views: 9297

Answers (2)

Marcelo Vinicius
Marcelo Vinicius

Reputation: 871

You've to add sonar.java.libraries as well. In this attribute you can add comma-separated paths to files with third-party libraries (JAR or Zip files) that are used by your project. Wildcards can be used:

Examples:

sonar.java.libraries=path/to/Library.jar,directory/**/*.jar

Upvotes: 0

TheStarkCoder
TheStarkCoder

Reputation: 21

Try adding this line of code in your sonar-project.properties file:

sonar.java.binaries=**/target/classes

You can read more info at: https://docs.sonarqube.org/latest/analysis/languages/java/

Upvotes: 1

Related Questions