时间戳转换工具

sonar公司产品sonarqube以最大限度地提高质量并管理软件产品组合中的风险。为开发者软件开发人员最终负责代码质量。代码质量是所谓的非功能性需求的一部分,因此是开发人员的直接责任。为有追求的程序员写出地道代码提供方向。支持27种语言。可接入CI/CD流程。

1.下载安装包

brew install sonarqube

brew install sonar-scanner

2. 配置

2.1 进入 sonarqube 的 conf 目录

cd /usr/local/Cellar/sonarqube/9.1.0.47736/libexec/conf

用记事本或 vim 命令打开编辑 sonar.properties,添加如下配置:

sonar.host.url=http://localhost:9000/sonarqube

#web登陆账号和密码

sonar.login=admin

sonar.password=admin


3.sonar配置

export SONAR_HOME=/usr/local/Cellar/sonarqube/9.1.0.47736

export SONAR_SCANNER_HOME=/usr/local/Cellar/sonar-scanner/4.6.2.2472_1

export PATH=$M2:$PATH:$SONAR_SCANNER_HOME/bin:$JAVA_HOME/bin

保存后,终端执行source ~/.bash_profile使环境变量生效最后,终端执行sonar-scanner --version,显示如下即配置成功:

INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.2.0.1873/libexec/conf/sonar-scanner.properties

INFO: Project root configuration file: NONE

INFO: SonarQube Scanner 4.2.0.1873

INFO: Java 1.8.0_191 Oracle Corporation (64-bit)

INFO: Mac OS X 10.14.5 x86_64


4、汉化

汉化下载地址:https://github.com/xuhuisheng/sonar-l10n-zh/releases/tag/sonar-l10n-zh-plugin-9.1

将生成的jar包放在/usr/local/Cellar/sonarqube/9.1.0.47736/libexec/extensions/plugins目录下


5、启动 sonarqube

cd /usr/local/Cellar/sonarqube/9.1.0.47736/bin

./sonar start

查看启动日志:

tail -f /usr/local/Cellar/sonarqube/9.1.0.47736/libexec/logs/sonar.xxx.log

关闭 sonarqube:

./sonar stop

启动 sonarqube 后,浏览器打开:http://localhost:9000默认登录用户名和密码均为:admin


参考地址:

http://events.jianshu.io/p/5e7c02c28537

https://cloud.tencent.com/developer/article/1706761

http://www.manongjc.com/detail/17-vwfeuiefrjnyuoq.html

联系我们 - 首页 - 关于我们
Copyright © 2017-2022 iteam. All Rights Reserved. Current version is 2.50.0.
粤ICP备17021424号
VV:34969 UV:113760 PV:388428