天天看点

Maven+Jenkins+Svn+Tomcat

使用Maven和Nexus保证开发人员引用统一的类库版本.

linux系统下jenkins的搭建:https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions (本章节不使用yum安装)

maven安装:官方下载:http://maven.apache.org/download.cgi

下载二进制包:apache-maven-3.5.0-bin.tar.gz

解压名添加环境变量:

export MAVEN_HOME=/usr/local/apache-maven-3.5.0

export PATH=$PATH:$MAVEN_HOME/bin

source /etc/profile

查看版本:

[[email protected] apache-maven-3.5.0]# mvn -v

Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)

Maven home: /usr/local/apache-maven-3.5.0

Java version: 1.8.0_131, vendor: Oracle Corporation

Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.131-2.b11.el7_3.x86_64/jre

Default locale: en_US, platform encoding: UTF-8

OS name: "linux", version: "3.10.0-514.16.1.el7.x86_64", arch: "amd64", family: "unix"

tomcat版本下载:http://apache.fayea.com/tomcat/

使用二进制包:

下载Tomcat7.0_77(或者其他版本)

wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.77/bin/apache-tomcat-7.0.77.zip

unzip apache-tomcat-7.0.77.zip

mv apache-tomcat-7.0.77 /usr/local/

cd /usr/local/apache-tomcat-7.0.77

然后下载:jenkins

wget http://mirrors.jenkins.io/war-stable/2.46.2/jenkins.war

mv jenkins.war /usr/local/apache-tomcat-7.0.77/webapps/

cd /usr/local/apache-tomcat-7.0.77/webapps/

在webapps目录下启动jenkins

注意关闭:防火墙 ->iptables或者firewall

指定端口:

java -jar jenkins.war --httpPort=8089      

访问jenkins:http://192.168.140.78:8089

Maven+Jenkins+Svn+Tomcat
Maven+Jenkins+Svn+Tomcat
Maven+Jenkins+Svn+Tomcat

svn参考文章:http://superleedo.blog.51cto.com/12164670/1888804

安装svn:

yum -y install subversion

mkdir /var/svn

svnadmin create /var/svn/project

svn import /etc/java file:///var/svn/project -m "java"

启动svn

svnserve -d -r /var/svn/project

用windows客户端检出 svn://192.168.140.78/project 测试是否成功

博客借鉴:http://www.cnblogs.com/leefreeman/p/4226978.html

Linux+Git+Maven+Jenkins+Neuxs自动化编译环境搭建 http://www.linuxidc.com/Linux/2016-02/128652.htm

CentOS6安装Jenkins http://www.linuxidc.com/Linux/2016-05/131365.htm

使用Jenkins配置Git+Maven的自动化构建 http://www.linuxidc.com/Linux/2016-02/128641.htm

Jenkins+Maven+Git搭建持续集成和自动化部署的配置手记 http://www.linuxidc.com/Linux/2015-06/118606.htm

Jenkins的分布式构建及部署——节点 http://www.linuxidc.com/Linux/2015-05/116903.htm

继续阅读