Sonarqube scan error with line out of range?

后端 未结 7 814
南方客
南方客 2020-12-30 23:26

[07:43:57]W: [Step 1/1] ERROR: Error during SonarQube Scanner execution

[07:43:57]W: [Step 1/1] ERROR: Line 523 is out of range in the file src/main/

相关标签:
7条回答
  • 2020-12-30 23:45

    I got the very same error with Azure DevOps Pipelines, but a cleanup before building the solution for sources and output did the job.

    Now everything is working fine again.

    0 讨论(0)
  • 2020-12-30 23:47

    I had the same issue when using sonar maven plugin and jacoco test reports. mvn sonar:sonar relies on an existintig jacoco report, when the source code was changed (lines had been removed), but the test report wasn't updated this error occurred. Running mvn clean test sonar:sonar solved it.

    0 讨论(0)
  • 2020-12-30 23:47

    In my case, an iOS project written in Swift had to remove previous reports. Just delete sonar-reports folder.

    0 讨论(0)
  • 2020-12-30 23:56

    For me it was because I had exactly the same class (for example com.test.MyClass) name and package name in two different sub modules (maven), MyClass in first module is larger i.e. 120 lines of code. MyClass in second module is shorter, then the exception was thrown since JaCoCo though the report was for that.

    Solution was to rename one of the classes or move it into a different package.

    i.e. : com.test.MyClass and com.test.MyClassB

    OR:

    com.test.MyClass and com.test.foo.MyClass

    0 讨论(0)
  • 2020-12-31 00:00

    I tried gradle clean buildand it worked for me

    0 讨论(0)
  • 2020-12-31 00:01

    If executing a maven clean does not work check if you have any old project folder that needs to be cleaned. Once you remove a submodule from the maven pom it won't remove the folder including the /target directory with the jacoco report from ages ago.

    0 讨论(0)
提交回复
热议问题