Sonar7.7安装

Posted by Epoch Blog on May 1, 2020

下载安装包

下载安装包sonarqube-7.7.zip

https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.7.zip

wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.7.zip

修改config下sonar.properties

配置IP,数据库等信息如下

sonar.jdbc.username=root

sonar.jdbc.password=password

sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false

sonar.web.port=9000

sonar.web.context=/

其他参数可选安装

启动

解压文件并修改目录为sonar

因linux启动sonar需要sonar用户,所以整体修改权限

chwon -R sonar:sonar sonar/

切换到sonar用户,进入到

sonar/bin/linux-x86-64

执行

sh sonar.sh start 即可启动

对应有restart,stop等

访问

http://IP:9000/路径

路径也是在配置文件配置的,默认没有

默认登录用户密码为admin

切换中文版

登录sonar界面后进入到如下

image-20211203204808051

搜索chinese

点install

耐心等待一段时间后出现如下

image-20211203204820093

点击重启

等待然后跳转登录界面

image-20211203204828883

重新登录就是中文了。

和jenkins关联

生成token

image-20211203204854923

创建项目

执行扫描

image-20211203204902666