天天看點

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

繼續閱讀