Kotlin analysis through sonnar-scanner

Versions:

  • SonarQube: 9.2.4
  • Scanner: sonar-scanner-4.6.2.2472-linux

We are trying to use sonar-scanner in our projects developed with kotlin + gradle. We are automating the execution of lots of projects, and we want to avoid touching the gradle file and add the plugin for sonarqube. We have to many projects with their own gradles, and is lot of time for our team to make an update into everyone of them. Instead, we want to execute sonnar-scanner in our projects that comes with our CI/CD automation already applied

Our sonar-project.properties is similar like below.

sonar.projectKey=com.artifact.id:our-project-name
sonar.projectName=Our-Project-Name

sonar.sources=src/main/kotlin
sonar.java.binaries=build/classes/kotlin/main
sonar.host.url=https://our.company.domain

#sonar.inclusions=*.kt
#sonar.kotlin.file.suffixes=.kt

The project appears in SonarQube dashboard in our https://our.company.domain host, but it doesn’t show any code. The code is not being analize.

¿Is it posible to run sonnar-scanner with kotlin code? We are searching but it seems everyone uses sonarqube plugin with gradle for kotlin project. We really appreciate your help on this issue.

Regards.

Hi,

Welcome to the community!

Please share your analysis log.

The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.

This guide will help you find them.

 
Ann