sonarqube5.5安装

1.安装mysql

 

安装的mysql的percona分支;

文档:http://www.percona.com/doc/percona-server/5.6/

 

安装包:Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar

百度云下载链接:https://pan.baidu.com/s/1Zp0ocOkr_rjXxizjvA1KaA 密码:e47f

 

首先安装cmake

yum -y install cmake

 

cd /usr/local/src/

mkdir mysql-percona

cd mysql-percona/

rz 上传安装包

 

tar -xvf Percona-Server-5.6.21-70.0-r688-el6-x86_64-bundle.tar

 

rpm -ivh Percona-Server-shared-56-5.6.21-rel70.0.el6.x86_64.rpm

rpm -ivh Percona-Server-client-56-5.6.21-rel70.0.el6.x86_64.rpm

rpm -ivh Percona-Server-server-56-5.6.21-rel70.0.el6.x86_64.rpm

 

启动:

service mysql start

 

修改root密码:

mysqladmin -u root password "root"

 

登录:

mysql -uroot -proot

 

设置远程访问(使用root密码):

grant all privileges on *.* to 'root' @'%' identified by 'root';

flush privileges;

 

防火墙打开3306端口

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

/etc/rc.d/init.d/iptables save

/etc/init.d/iptables status

 

 

2.创建数据库

 

在mysql中执行如下脚本创建数据库及mysql用户

CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE USER 'sonar' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar';
GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar';

 

3.安装sonarqube

 

sonarqube5.5 百度云下载地址链接:https://pan.baidu.com/s/1dZm5jUZiGha0edPEsom2_g 密码:hq4u

 

解压sonarqube-5.5.zip

#unzip sonarqube-5.5.zip

编辑${SONAR_HOME}/conf/sonar.properties配置数据库:

sonar.jdbc.username:sonar
sonar.jdbc.password:sonar
sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true

# Optional properties  

sonar.jdbc.driverClassName: com.mysql.jdbc.Driver

 

启动服务
目录切换至sonar的<install_directory>/bin/linux-x86-64/目录,启动服务
#./sonar.sh start   启动服务
#./sonar.sh stop    停止服务
#./sonar.sh restart 重启服务

至此,sonar就安装好了
本机访问http://localhost:9000即可

 

4.分析maven项目

Edit the settings.xml file, located in $MAVEN_HOME/conf or ~/.m2, to set the plugin prefix and optionally the SonarQube server URL.

Example:

<settings>

    <pluginGroups>

        <pluginGroup>org.sonarsource.scanner.maven</pluginGroup>

    </pluginGroups>

    <profiles>

        <profile>

            <id>sonar</id>

            <activation>

                <activeByDefault>true</activeByDefault>

            </activation>

            <properties>

                <sonar.host.url>

                  http://myserver:9000

                </sonar.host.url>

            </properties>

        </profile>

     </profiles>

</settings>

 

Analyzing a Maven project consists of running a Maven goal: sonar:sonar in the directory where the pom.xml file sits.

mvn clean verify sonar:sonar

 

# In some situation you may want to run sonar:sonar goal as a dedicated step. Be sure to use install as first step for multi-module projects

mvn clean install

mvn sonar:sonar

 

# Specify the version of sonar-maven-plugin instead of using the latest. See also 'How to Fix Version of Maven Plugin' below.

mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值