sakurayz 2015-07-25
create database sonar default charset=utf8;
create user 'sonar' identified by 'sonar123'; grant all on sonar.* to 'sonar'@'%' identified by 'sonar123'; grant all on sonar.* to 'sonar'@'localhost' identified by 'sonar123'; flush privileges;
sonar.jdbc.username=sonar sonar.jdbc.password=sonar123 sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance
sonar.host.url=http://localhost:9000 sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 sonar.jdbc.username=sonar sonar.jdbc.password=sonar123 sonar.sourceEncoding=UTF-8 sonar.login=admin sonar.password=admin
sudo vi ~/.bash_profile # sonar config export SONAR_HOME=/Users/jiangzhiqiang/dev/sonarqube-5.1.1 export SONAR_RUNNER_HOME=/Users/jiangzhiqiang/dev/sonar-runner-2.4 export PATH=${PATH}:${SONAR_RUNNER_HOME}
source ~/.bash_profile
echo $SONAR_HOME
./sonar.sh restart
# required metadata # projectKey 是项目的唯一标识,不能重复 sonar.projectKey=pattern sonar.projectName=pattern sonar.projectVersion=1.0 sonar.sourceEncoding=UTF-8 sonar.modules=java-module #sonar.modules=java-module,javascript-module,html-module # Java module java-module.sonar.projectName=Java Module java-module.sonar.language=java # sources为源码目录 java-module.sonar.sources=src # .表示projectBaseDir指定的目录 java-module.sonar.projectBaseDir=. # binaries为编译后的classes目录,这个目录要注意一下, # 如果都在bin下面或者目录还有很多层级才到classe目录,可以直接为sonar.binaries=bin, # sonar会自动遍历所有目录 sonar.binaries=target/classes # JavaScript module #javascript-module.sonar.projectName=JavaScript Module #javascript-module.sonar.language=js #javascript-module.sonar.sources=js #javascript-module.sonar.projectBaseDir=webapp # webroot \src\main\webapp # Html module #html-module.sonar.projectName=Html Module #html-module.sonar.language=web #html-module.sonar.sources=pages #html-module.sonar.projectBaseDir=webapp