sonar-scanner配置
作者:互联网
一、scanner
1.配置运行环境
将sonar-scanner压缩包解压至目录。
将bin添加到系统运行环境
sudo vim /etc/profile
export PATH=/home/conan/Git_project/conchpilot2.0/conchpilot2.0/sonar-scanner/bin:$PATH
根据实际路径改path。
source /etc/profile 或者 reboot
2.修改conf下面参数
#Configure here general information about the environment, such as SonarQube server connection details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://119.45.126.112:9000
#----- Default source code encoding
sonar.sourceEncoding=UTF-8
3.查询版本号
sonar-scanner -v
二、cppcheck
sudo apt-get install cppcheck
cppcheck --version
三、运行
sonar-scanner -Dsonar.cxx.cppcheck.reportPaths=cppcheck_report.xml -Dsonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h -Dsonar.projectKey=cpp -Dsonar.sources=. -Dsonar.host.url=http://119.45.126.112:9000 -Dsonar.login=0afa59b8f92007448d61f97778307c39ccfe2cfc
标签:scanner,cxx,配置,Dsonar,126.112,sonar,cppcheck 来源: https://www.cnblogs.com/qijiajun/p/16504444.html