zmsp/sonar-clojure

Can't get sonar-clojure to work

Closed this issue · 2 comments

n2o commented

Still, my clojure projects can't be analyzed by Sonarqube. We had some issues to get it running with no errors, but you solved this in the last issues.

But still the reports are not transferred to sonarqube. Even an empty project lein new app foo results in an empty report.

That's the case with all my projects, which is why I nearly abandoned this project and thought about solving this by myself. But maybe you know what the problem is. Other projects (written in Python, JS, ...) are working properly in our Sonarqube installation. But Clojure / Clojurescript projects don't appear with the contents of the report in Sonarqube.

The empty project produces this log in the console:

$ lein new app foo
$ cd foo
# create minimal sonar-project.properties
$ sonar-scanner
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /tmp/foo/foo/sonar-project.properties
INFO: SonarQube Scanner 3.0.1.733
INFO: Java 1.8.0_144 Oracle Corporation (64-bit)
INFO: Linux 4.12.12-1-ARCH amd64
INFO: User cache: /home/n2o/.sonar/cache
INFO: Load global settings
INFO: Load global settings (done) | time=198ms
INFO: User cache: /home/n2o/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=10ms
INFO: SonarQube server 6.4.0
INFO: Default locale: "de_DE", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=17ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=27ms
INFO: Load active rules
INFO: Load active rules (done) | time=838ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=91ms
WARN: SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
INFO: Publish mode
INFO: Project key: test
INFO: -------------  Scan test
INFO: Load server rules
INFO: Load server rules (done) | time=123ms
INFO: Initializer GenericCoverageSensor
INFO: Initializer GenericCoverageSensor (done) | time=0ms
INFO: Base dir: /tmp/foo/foo
INFO: Working dir: /tmp/foo/foo/.scannerwork
INFO: Source paths: .
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: Excluded sources: 
INFO:   target/**
INFO: 8 files indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Sensor InspectClojureSensor [InspectClojure]
INFO: Clojure project detected, running sonar-clojure
INFO: ●▬▬▬▬▬▬▬▬▬● Running file finder ●▬▬▬▬▬▬▬▬▬●
INFO: ●▬▬▬▬▬▬▬▬▬● Running Eastwood ●▬▬▬▬▬▬▬▬▬●
INFO: == Eastwood 0.2.4 Clojure 1.8.0 JVM 1.8.0_144
INFO: Directories scanned for source files:
INFO:   src test
INFO: == Linting foo.core ==
INFO: == Linting foo.core-test ==
INFO: == Warnings: 0 (not including reflection warnings)  Exceptions thrown: 0
INFO: ●▬▬▬▬▬▬▬▬▬● Running Kibit ●▬▬▬▬▬▬▬▬▬●
INFO: No error found from kibit analysis
INFO: ●▬▬▬▬▬▬▬▬▬● Saving measures ●▬▬▬▬▬▬▬▬▬●
INFO: Sensor InspectClojureSensor [InspectClojure] (done) | time=28697ms
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=5ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=11ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 107ms, dir size=27 KB
INFO: Analysis reports compressed in 9ms, zip size=7 KB
INFO: Analysis report uploaded in 229ms
INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube.cs.uni-duesseldorf.de/dashboard/index/test
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at https://sonarqube.cs.uni-duesseldorf.de/api/ce/task?id=AV5v5Pr5zDI1T0grUpSB
INFO: Task total time: 33.106 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 34.947s
INFO: Final Memory: 51M/334M
INFO: ------------------------------------------------------------------------
sonar-scanner  66,65s user 2,14s system 194% cpu 35,355 total

The project appears in Sonarqube, but no contents are available. I had some html files in it in a different project and those html-files were analyzed, but that was not what I was looking for ;-)

Do I have to enable something in my Sonarqube installation to get this plugin to work?

Thanks!

zmsp commented

I believe you have to use an older version of sonarqube. It doesn't work on SonarQube version 6 because of missing dashboard feature. Try running it on SonarQube 5.6.6 (LTS *).

n2o commented

Okay... That's not possible, we are using a company-wide installation of SonarQube. Too bad :-( Yes, we are using Sonarqube 6.5