sonarQube代码上传报错
ERROR: Error during SonarScanner execution
ERROR: Language of file 'Supporting Files/BridgeHeader.h' can not be decided as the file matches patterns of both sonar.lang.patterns.objc : **/*.h,**/*.m,**/*.mm and sonar.lang.patterns.c++ : **/*.cxx,**/*.cpp,**/*.cc,**/*.c,**/*.hxx,**/*.hpp,**/*.hh,**/*.h
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
解决方法
1,
运行到最后会报错,错误原因是不能决定使用sonar.lang.patterns.c++还是使用sonar.lang.patterns.c解析.c文件。这是因为前面安装的sonar-c-plugin和sonar-cxx-plugin插件都有对.c和.h扩展名的设置,因为我们分析的是C语言工程,可以将sonar-cxx-plugin的配置去掉,如下:

2,
在sonar-project.properties中添加sonar.language=c,指定使用c插件来运行
参考链接:https://www.freesion.com/article/3192617572/
在SonarQube分析C语言工程时遇到错误,错误信息表明文件匹配了C++和C的解析规则。解决方法是在sonar-project.properties文件中添加sonar.language=c,指定使用C语言插件进行分析,从而避免解析冲突。移除不必要的sonar-cxx-plugin配置也能解决问题。
18万+





