Sonarqube scan error with line out of range?(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:[Step 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.
推荐答案
我在使用 sonar 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 扫描错误,行超出范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Sonarqube 扫描错误,行超出范围?
基础教程推荐
- 降序排序:Java Map 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01