4

Currently we are using an Sonar On-Premise installation. (7.9.3.X)

We send our Sonar Analysis via the maven goal "mvn sonar:sonar" to our Sonar Server. We have the Server URL and the authentication configured in our .m2/settings.xml.

If I am triggering the goal it does not select the Quality Profiles for Java.

[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=62ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1159ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] 1 file indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for xml: Sonar way

I tried to set:

<sonar.java.binaries>target/classes</sonar.java.binaries>

For testing the "Findbugs" Way

<sonar.sources>src/main/</sonar.sources>

for testing the "Sonar Way"

and the deprecated Setting

<sonar.language>java</sonar.language>

but the configuration does not Scan for Java Files.

The current sonar properties I set are:

<sonar.host.url>https://sonar:9000</sonar.host.url>
<sonar.login>secrettoken</sonar.login>
<sonar.projectName>myproject</sonar.projectName>
<sonar.sources>.</sonar.sources>

In other Projects Scanning for Java files succeed. In my effective Pom of the Project ("mvn help:effective-pom") I cannot found any exclusions nor a language "preselection".

What am I missing? Anyone else faced this Problem?

Thanks for your help!

sdsys22
  • 41
  • 3
  • Can you share your sonar.properties that you are using and also let me know, if you are using branch analysis? – Sourav Jul 28 '20 at 03:58
  • Dear sourvatta, we use SonarQube OSS therefore we do not have the "branch"-analysis feature. Kind regards sdsys22 – sdsys22 Jul 28 '20 at 05:41

1 Answers1

0

Try with this

<sonar.sources>UTF-8</sonar.sources>
<sonar.sources>.</sonar.sources>
  • i tried with "sonar.sourceEncoding=UTF8" and "sonar.source = "." but it analyses even more XML Files X( – sdsys22 Jul 28 '20 at 09:39