英文:
SonarQube does not indexes/find JAVA files
问题
目前我们正在使用 Sonar On-Premise 安装版(7.9.3.X)。
我们通过 Maven 目标 "mvn sonar:sonar" 将 Sonar 分析发送到我们的 Sonar 服务器。我们在 .m2/settings.xml
中配置了服务器 URL 和身份验证。
如果我触发该目标,它不会选择 Java 的质量配置文件。
[INFO] 加载质量配置文件
[INFO] 加载质量配置文件(完成)| 时间=62毫秒
[INFO] 加载活动规则
[INFO] 加载活动规则(完成)| 时间=1159毫秒
[INFO] 正在索引文件...
[INFO] 项目配置:
[INFO] 已索引 1 个文件
[INFO] 由于源代码管理忽略设置,忽略了 0 个文件
[INFO] XML 的质量配置文件: Sonar way
我尝试设置:
<sonar.java.binaries>target/classes</sonar.java.binaries>
用于测试 "Findbugs" 方式
<sonar.sources>src/main/</sonar.sources>
用于测试 "Sonar Way"
以及不推荐使用的设置
<sonar.language>java</sonar.language>
但是配置不会扫描 Java 文件。
我设置的当前 Sonar 属性是:
<sonar.host.url>https://sonar:9000</sonar.host.url>
<sonar.login>secrettoken</sonar.login>
<sonar.projectName>myproject</sonar.projectName>
<sonar.sources>.</sonar.sources>
在其他项目中,扫描 Java 文件是成功的。
在项目的有效 POM 中("mvn help:effective-pom"),我找不到任何排除项或语言 "预选"。
我漏掉了什么?还有其他人遇到过这个问题吗?
感谢您的帮助!
英文:
Currently we are using an Sonar On-Premise installation. (7.9.3.X)
We send our Sonar Analysis via the maven goal "mvn sonar:sonar" to our Sonar Server. We have the Server URL and the authentication configured in our .m2/settings.xml
.
If I am triggering the goal it does not select the Quality Profiles for Java.
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=62ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1159ms
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] 1 file indexed
[INFO] 0 files ignored because of scm ignore settings
[INFO] Quality profile for xml: Sonar way
I tried to set:
<sonar.java.binaries>target/classes</sonar.java.binaries>
For testing the "Findbugs" Way
<sonar.sources>src/main/</sonar.sources>
for testing the "Sonar Way"
and the deprecated Setting
<sonar.language>java</sonar.language>
but the configuration does not Scan for Java Files.
The current sonar properties I set are:
<sonar.host.url>https://sonar:9000</sonar.host.url>
<sonar.login>secrettoken</sonar.login>
<sonar.projectName>myproject</sonar.projectName>
<sonar.sources>.</sonar.sources>
In other Projects Scanning for Java files succeed.
In my effective Pom of the Project ("mvn help:effective-pom") I cannot found any exclusions nor a language "preselection".
What am I missing? Anyone else faced this Problem?
Thanks for your help!
答案1
得分: 0
尝试使用以下内容:
<sonar.sources>UTF-8</sonar.sources>
<sonar.sources>.</sonar.sources>
英文:
Try with this
<sonar.sources>UTF-8</sonar.sources>
<sonar.sources>.</sonar.sources>
专注分享java语言的经验与见解,让所有开发者获益!
评论