Sonarqube扫描错误,且线路超出范围? [英] Sonarqube scan error with line out of range?

查看:101
本文介绍了Sonarqube扫描错误,且线路超出范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[07:43:57] W:[步骤1/1]错误:SonarQube扫描仪执行期间出错

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

[07:43:57] W:[步骤1/1]错误:文件中的第523行超出范围src/main/java/com/company/package/File.java(行:522)

[07:43:57]W: [Step 1/1] ERROR: Line 523 is out of range in the file src/main/java/com/company/package/File.java (lines: 522)

由于某种原因,Sonarqube在第523行报告了一个错误,但是源文件中只有522行?

For some reason Sonarqube is reporting an error on line 523 but there is only 522 lines in the source file ?

我在上一个文件中看到了这一点,但是当我在其末尾添加一个空行时,问题就消失了,该文件的末尾已经有一个空行了.

I saw this on a previous file, but when I added a blank line to the end of it the problem went away, this file already has a blank line at the end of it.

推荐答案

在使用声纳maven插件和jacoco测试报告时,我遇到了同样的问题. mvn sonar:sonar 依赖于一份现存的jacoco报告,当源代码更改(行已删除)但未更新测试报告时,发生此错误.运行 mvn clean test sonar:sonar 解决了该问题.

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.

这篇关于Sonarqube扫描错误,且线路超出范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆