Ame*_*sse 20 java git maven jenkins sonarqube
我Missing blame information for the following files
在SonarQube的分析过程中收到了警告.
[INFO] [22:19:57.714] Sensor SCM Sensor
[INFO] [22:19:57.715] SCM provider for this project is: git
[INFO] [22:19:57.715] 48 files to be analyzed
[INFO] [22:19:58.448] 0/48 files analyzed
[WARN] [22:19:58.448] Missing blame information for the following files:
(snip 48 lines)
[WARN] [22:19:58.449] This may lead to missing/broken features in SonarQube
[INFO] [22:19:58.449] Sensor SCM Sensor (done) | time=735ms
Run Code Online (Sandbox Code Playgroud)
我正在使用SonarQube 5.5,分析由Maven在Jenkins工作中完成,在多模块Java项目上完成.安装了Git插件1.2.
在bash shell中,在任何有问题的文件上手动运行git blame,都会给出预期的输出.
我发现的相关问题都与SVN有关,我的问题在于Git.
我怎样才能获得关于Sonarqube的git blame信息?
Ame*_*sse 13
原因是JGit错误.JGit不支持.gitattributes
.我有ident
我的.gitattributes
.平原控制台git
签出的来源,适用ident
于$Id$
宏,但随后JGit忽略了,看到没被提交的,那里居然没有一个差异.
SonarQube邮件列表上的友好人员帮助了我,并建议使用独立的JGit命令行分发进行调试:
chmod +x /where/is/org.eclipse.jgit.pgm-<version>-r.sh
/where/is/org.eclipse.jgit.pgm-<version>-r.sh blame -w /path/to/offending/file
Run Code Online (Sandbox Code Playgroud)
这个特殊的JGit漏洞已经有5年没有解决了,我不希望它会很快得到解决,所以我$Id$
从我的所有资源中删除了这些宏.
这是我用来删除所有$Id$
宏的(Bash)代码:
find */src -name "*.java" | xargs -n 1 sed -i '/$Id.*$/d'
find */src -name "*.java" | xargs git add
git commit -m "Remove $Id$ macros"
git push
Run Code Online (Sandbox Code Playgroud)
我有一个类似的问题:我的项目中的一个文件是在构建过程中创建的,并且没有存储在源代码管理中。就我而言,它是api.json
.
在 Team City 的 SonarQube runner 构建步骤中,我将此文件添加到附加参数中的排除项中
-Dsonar.exclusions=**/spec/api.json
Run Code Online (Sandbox Code Playgroud)
并且错误消失了。
归档时间: |
|
查看次数: |
34994 次 |
最近记录: |