No input file found for, no detekt issues will be imported on this file

Hi! I have a multi-module gradle project, which has a Sonar intergration, and I wish to use Detekt metrics inside Sonar. Here is my root gradle build file sonar entry. I have setup sources and test for all the subprojects.

property("sonar.sources", "src/main")
property("sonar.tests", "src/test")

But when I run gradle sonarqube task, I keep getting errors like:

No input file found for /Users/gopala.akshintala/code-clones/work/vader-root/vader/src/main/org/revcloud/vader/runner/Utils.kt. No detekt issues will be imported on this file.

Please help!

Hello,

As mentioned in this other thread, you should make sure all the Kotlin files are referenced by the “sonar.sources” property. If this is not the case, they won’t be made visible by the Scanner for Gradle and so issues raised by SonarQube or Detekt related to Kotlin files won’t be loaded.

What is surprising is that in your Detekt results you have a path with:

vader-root/ vader/build/generated/sources/delombok /java/main/org/revcloud/vader/runner/Utils.kt

whereas your Utils.kt file is located in vader-root/vader/src/main/java/org/revcloud/vader/runner/Utils.kt

Why the Detekt results contains a path which doesn’t match what is in your code repo? I would first look at the Detekt options to see if there is something to tune here.

Alex

Hi @Alexandre_Gigleux thanks for looking into. I updated the path, my bad pasting the wrong one. As per the thread you referred, I made sure sources are set for all the projects. Yet I get this. You may look at my gradle config here: