包含qube今日价格与行情的词条( 二 )


[java] view plain copy
#Configure here general information about the environment, such as SonarQube DB details for example
#No information about specific project should appear here
#—– Default SonarQube server
sonar.host.url=http://localhost:9000
#—– PostgreSQL
#sonar.jdbc.url=jdbc:postgresql://localhost/sonar
#—– MySQL
sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
#—– Oracle
#sonar.jdbc.url=jdbc:oracle:thin:@localhost/XE
#—– Microsoft SQLServer
#sonar.jdbc.url=jdbc:jtds:sqlserver://localhost/sonar;SelectMethod=Cursor
#—– Global database settings
sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
#—– Default source code encoding
sonar.sourceEncoding=UTF-8
#—– Security (when \’sonar.forceAuthentication\’ is set to \’true\’)
sonar.login=admin
sonar.password=admin
3.添加数据库驱动
除了Oracle数据库外,其它数据库驱动都默认已经提供了,且这些已添加的驱动是sonar唯一支持的,因此不需要修改
如果是Oracle数据库,需要复制JDBC驱动至/extensions/jdbc-driver/oracle目录
4.启动服务
目录切换至sonar的/bin/linux-x86-64/目录,启动服务
#./sonar.sh start启动服务
#./sonar.sh stop停止服务
#./sonar.sh restart 重启服务
至此,sonar就安装好了
访问http:\\\\localhost:9000即可
5.sonar中文补丁包安装
中文包安装
安装中文补丁包可以通过访问http:\\\\localhost:9000,打开sonar后,进入更新中心安装
或者下载中文补丁包后,放到SONARQUBE_HOME/extensions/plugins目录,然后重启SonarQube服务
sonar作为Linux服务并开机自启动
新建文件/etc/init.d/sonar,输入如下内容:
[java] view plain copy
#!/bin/sh
#
# rc file for SonarQube
#
# chkconfig: 345 96 10
# description: SonarQube system (www.sonarsource.org)
#
### BEGIN INIT INFO
# Provides: sonar
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: SonarQube system (www.sonarsource.org)
# Description: SonarQube system (www.sonarsource.org)
### END INIT INFO
/usr/bin/sonar $*
SonarQube开机自启动(Ubuntu, 32位):
sudo ln -s $SONAR_HOME/bin/linux-x86-32/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo update-rc.d sonar defaults
SonarQube开机自启动(RedHat, CentOS, 64位):
sudo ln -s $SONAR_HOME/bin/linux-x86-64/sonar.sh /usr/bin/sonar
sudo chmod 755 /etc/init.d/sonar
sudo chkconfig –add sonar
使用SonarQube Runner分析源码
预置条件
已安装SonarQube Runner且环境变量已配置,即sonar-runner命令可在任意目录下执行
1.在项目源码的根目录下创建sonar-project.properties配置文件
以Android项目为例:
[java] view plain copy
sonar.projectKey=android-sonarqube-runner
sonar.projectName=Simple Android project analyzed with the SonarQube Runner
sonar.projectVersion=1.0
sonar.sources=src
sonar.binaries=bin/classes
sonar.language=java
sonar.sourceEncoding=UTF-8
sonar.profile=Android Lint
如何使用sonarqube与jenkins【包含qube今日价格与行情的词条】只需要把sonar信息配置在maven conf settings.xml里面的 里,如 sonar http://ip:9000 jdbc:h2:tcp://ip:9092/sonar org.h2.Driver sonar sonar sonar ,并默认激活 。再在 jenkins里面配置命令clean test sonar:sonar -Dsonar.forceAnalysis=true…
mysql 5627与sonarqube61匹配吗新建SONAR_HOME=D:\\sonar\\sonarqube-4.5.7\\sonarqube-4.5.7

推荐阅读