1
votes

Currently sonar runner is not publishing jacoco information to sonarcube for a scala project.

What works

  • Jacoco has been run via jacoco:cover, a report exists in HTML and .exec format.
  • Sonar runner is publishing code file metrics to sonarcube

There is no coverage information displayed in sonarcube. And also the jacoco sensor is not run by sonar runner.

Output of sonar runner

14:34:45.995 INFO  - Sensor ScalaSourceImporterSensor done: 1635 ms
14:34:45.995 INFO  - Sensor BaseMetricsSensor...
:1: error: illegal character
Defines an application’s global settings.
                      ^
14:34:47.639 INFO  - Sensor BaseMetricsSensor done: 1644 ms
14:34:47.639 INFO  - Sensor InitialOpenIssuesSensor...
14:34:47.643 INFO  - Sensor InitialOpenIssuesSensor done: 4 ms
14:34:47.643 INFO  - Sensor ProfileSensor...
14:34:47.752 INFO  - Sensor ProfileSensor done: 109 ms
14:34:47.753 INFO  - Sensor ProfileEventsSensor...
14:34:47.768 INFO  - Sensor ProfileEventsSensor done: 15 ms
14:34:47.768 INFO  - Sensor ProjectLinksSensor...
14:34:47.772 INFO  - Sensor ProjectLinksSensor done: 4 ms
14:34:47.772 INFO  - Sensor VersionEventsSensor...
14:34:47.779 INFO  - Sensor VersionEventsSensor done: 7 ms
14:34:47.990 INFO  - Execute decorators...

Interesting Note

Once the property sonar.language is set to java the jacoco sensor is executed and the widget for code coverage in sonar runner is shown. Although it displays 0% code coverage. Probably a side effect of switching to java when the project really is scala.

Will post additional configuration if need but don't want to bloat this post up front.

How can jacoco coverage be sent to sonar cube via sonar runner for a scala project?

1

1 Answers

1
votes

It seems the sonar jacoco plugin is tied to java and scala is not currently supported.

Reference: http://sonarqube.15.x6.nabble.com/Run-sonar-jacoco-plugin-for-a-scala-project-td5011279.html