xp搭建sonar
1.http://www.sonarsource.org/downloads/下载sonar,解压到F:\sonar-2.14
2.加数据库和用户
create database sonar;
grant all on sonar.* to sonar@'localhost' identified by 'sonar';
3.修改配置F:\sonar-2.14\conf\sonar.properties
注释这句
#sonar.jdbc.url: jdbc:derby://localhost:1527/sonar;create=true
sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true
sonar.jdbc.driverClassName: com.mysql.jdbc.Driver
sonar.jdbc.validationQuery: select 1
4.修改maven的配置setting.xml
加上
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- mysql -->
<sonar.jdbc.url>
jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
</sonar.jdbc.url>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>sonar</sonar.jdbc.username>
<sonar.jdbc.password>sonar</sonar.jdbc.password>
<!-- remote host -->
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
5.启动: 运行F:\sonar-2.14\bin\windows-x86-32\StartSonar.bat
6.加项目:mvn clean install sonar:sonar
帮助文档
http://docs.codehaus.org/display/SONAR/Documentation