应用环境:JDK、Maven、Jenkins、Sonar
一、JDK安装
1、去官方网站选择你需要的版本,下载rpm包, ;
2、安装rpm包,命令:rpm -ivh jdk-6u45-linux-amd64.rpm;
3、配置JDK环境变量:
[root@localhost tools]# vim /etc/profile
添加下面信息:
#Java Profile
export JAVA_HOME=/usr/java/jdk1.6.0_45 (按照自己的真实目录)
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
保存退出;
4、使环境变量生效:[root@localhost tools]#source /etc/profile
5、试验下:
[root@localhost tools]# echo $JAVA_HOME
/usr/java/jdk1.6.0_45
成功!
二、Maven安装
下载maven安装软件到本地目录,/usr/(自己随便选择下载目录,只是下面配置环境变量时注意);
wget

2、解压安装包;
[root@localhost usr]# tar -zxf apache-maven-3.2.2-bin.tar.gz
3、修改环境变量,增加如下一段:
export M3_HOME=/usr/apache-maven-3.2.2
export PATH=${M3_HOME}/bin:${PATH}

4、使环境变量生效;
[root@localhost usr]# source /etc/profile
5、检验安装是否成功;
[root@localhost usr]# mvn -version
如果出现类似于下面的就代表成功了;

三、sonar安装
1、下载软件:wget
2、解压软件:unzip sonar-3.7.4.zip
3、这里首先需要配置数据库信息:
前提是你已经安装了mysql数据库;
mysql> CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> grant all on sonar.* to sonar identified by 'sonar';
mysql> grant all on sonar.* to sonar@'192.168.30.70' identified by 'sonar';
mysql> flush privileges;
4、
Sonarqube
环境配置
Sonarqube
环境配置
sonarqube 环境配置
[root@localhost data]# vim /usr/sonar-3.7.4/conf/sonar.properties
修改如下字段(就是配置数据库信息,其他不用动):


5、在maven中配置sonarqube
[root@localhost data]# vim /usr/maven/conf/settings.xml
配置仓库存放文件地址(可自己设置):

配置sonar

5、启动sonar
[root@localhost data]# /usr/sonar-3.7.4/bin/linux-x86-64/sonar.sh start
6、在浏览器中查看
页面如下:

四、Jenkins安装
1、
注册
Jenkins repo
地址
注册Jenkins repo地址
[root@localhost ~]# wget -O /etc/yum.repos.d/jenkins.repo
[root@localhost ~]# rpm --import
2、yum安装软件
[root@localhost ~]# yum install -y jenkins

3、启动Jenkins
[root@localhost logs]# service jenkins start
4、远程访问方式
所有需要的软件安装完成了,怎么在Jenkins里面创建项目,需要安装何种插件等,后面会重新写一篇;
阅读(1409) | 评论(0) | 转发(0) |