java - Sonarqube: Missing blame information for the following files -


i getting warning missing blame information following files during analysis sonarqube.

[info] [22:19:57.714] sensor scm sensor [info] [22:19:57.715] scm provider project is: git [info] [22:19:57.715] 48 files analyzed [info] [22:19:58.448] 0/48 files analyzed [warn] [22:19:58.448] missing blame information following files: (snip 48 lines) [warn] [22:19:58.449] may lead missing/broken features in sonarqube [info] [22:19:58.449] sensor scm sensor (done) | time=735ms 

i using sonarqube 5.5, analysis done maven in jenkins job, on multi-module java project. git plugin 1.2 installed.

manually running git blame in bash shell, on of offending files, gives expected output.

related questions found svn, issue git.

how git blame information on sonarqube?

the cause jgit bug. jgit not support .gitattributes. had ident in .gitattributes. plain console git checked out source, applied ident on $id$ macros, jgit ignored , saw difference wasn't committed, there wasn't one.

the friendly people on sonarqube mailing list helped me out, , suggested debugging standalone jgit command line distribution:

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 

this particular jgit bug has not been solved on 5 years , have no hope solved anytime soon, removed $id$ macros sources.

this (bash) code used, remove $id$ macros:

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 

Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -