I. Pre-conditions
The system environment is:
[Email protected] application]# cat/etc/redhat-release
CentOS Release 6.7 (Final)
[Email protected] application]# uname-r
2.6.32-573.el6.x86_64
The installation package that needs to be prepared is:
Subversion-1.6.1.tar.gz
Subversion-deps-1.6.1.tar.gz
Apache-maven-3.3.3-bin.tar.gz
Second, SVN part
[Email protected] application]# pwd
/application
#上传subversion -1.6.1.tar.gz and subversion-deps-1.6.1.tar.gz to this directory
[Email protected] application]# Tar XF subversion-1.6.1.tar.gz
[Email protected] application]# Tar XF subversion-deps-1.6.1.tar.gz
#创建编译路径
[Email protected] application]# mkdir Subversion
[Email protected] application]# ls-ld Subversion
Drwxr-xr-x 2 root root 4096 Sep 1 11:46 Subversion
[Email protected] application]# CD subversion-1.6.1
[Email protected] subversion-1.6.1]#./configure--prefix=/application/subversion
Checking Openssl/opensslv.h usability ... no
Checking Openssl/opensslv.h presence ... no
Checking for openssl/opensslv.h ... no
Configure:error:We require OpenSSL; Try--with-openssl
Configure failed for serf
#如果编译结束出现上述错误, you will need to install the following software to compile again
[email protected] subversion-1.6.1]# Yum install OpenSSL openssl-devel-y
[[email protected] subversion-1.6.1] #make && make install
[[email protected] subversion-1.6.1] #cd/application/subversion/bin
[Email protected] bin]# Svnserve--version
Svnserve, Version 1.6.11 (r934486)
Compiled Jul 23 2015, 23:48:52
Copyright (C) 2000-2009 CollabNet.
Subversion is open source software, see http://subversion.tigris.org/
This product includes software developed by CollabNet (http://www.Collab.Net/).
The following repository back-end (FS) modules is available:
* Fs_base:module for working with a Berkeley DB repository.
* Fs_fs:module for working with a plain file (FSFS) repository.
Cyrus SASL authentication is available.
[Email protected] bin]# cd/application/
[Email protected] application]# ln-s/APPLICATION/SUBVERSION/APPLICATION/SVN
[[email protected] application]# ls svn/
Bin Build-1 include Lib share
[Email protected] application]# echo "Path=/application/svn/bin: $PATH" >>/etc/profile
[Email protected]ofttest application]# svnserve--version
[Email protected] application]# tail-1/etc/profile
path=/application/svn/bin:/application/maven/bin:/application/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/ Bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
[Email protected] application]# Source/etc/profile
[Email protected] application]# Svnserve--version
#创建SVN版本库
[Email protected] application]# mkdir/application/svnrepos-p
[Email protected] application]# svnadmin Create/application/svnrepos
#修改SVN版本库配置文件
[Email protected] application]# CD Svnrepos
[[email protected] svnrepos]# ls
Conf db format Hooks Locks README.txt
[Email protected] svnrepos]# CD conf/
[email protected] conf]# CP svnserve.conf Svnserve.conf.ori
[Email protected] conf]# egrep "Anon-access|auth-access|password-db"/application/svnrepos/conf/svnserve.conf
# anon-access = Read
Anon-access = none# makes it inaccessible to non-authorized users
# auth-access = Write
Auth-access = write# enables authorized users to have write permissions
# # # The PASSWORD-DB option controls the location of the password
# password-db = passwd
Password-db = passwd# Indicates the password file path
#修改SVN版本库用户
[email protected] conf]# CP passwd Passwd.ori
#在最下面按照格式加入svn的用户名和密码
[Email protected] conf]# grep username passwd
Username = password
#创建自定义存放项目的路径
[Email protected] conf]# mkdir/home/sourcecode-p
[Email protected] conf]# CD home/
[[Email protected] home]# SVN co svn://ip/java/jy_cps/jy-cps-parent/home/sourcecode
[[email protected] home]# ls sourcecode/
Jy-cps-parent
[[email protected] home]# ls sourcecode/jy-cps-parent/
Jy-cps-common Jy-cps-mis Pom.xml
Third, the MAVEN part
#上传apache-maven-3.3.3-bin.tar.gz
[Email protected] application]# Tar XF apache-maven-3.3.3-bin.tar.gz
[Email protected] application]# ln-s/application/apache-maven-3.3.3/application/maven
#注意此处的maven版本必须是JDK1.7,maven version and Java version of the use of the reference map please refer to http://maven.apache.org/docs/history.html
[Email protected] application]#/application/maven/bin/mvn-version
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22t19:57:37+08:00)
Maven Home:/application/maven
Java version:1.7.0_79, Vendor:oracle Corporation
Java Home:/application/jdk1.7.0_79/jre
Default Locale:en_us, Platform Encoding:utf-8
OS name: "Linux", Version: "2.6.32-573.el6.x86_64", Arch: "AMD64", Family: "Unix"
[Email protected] application]# echo "Path=/application/maven/bin: $PATH" >>/etc/profile
[Email protected] application]# tail-1/etc/profile
path=/application/svn/bin:/application/maven/bin:/application/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/ Bin:/usr/sbin:/usr/bin:/root/bin:/root/bin
[Email protected] application]# mvn-version
#创建本地maven仓库 (Place the jar package that the MAVEN project relies on, as it will be found in this directory when the MAVEN project is compiled, and if the corresponding jar package is not found, it will be downloaded to the MAVEN or internet maven repository)
[Email protected] application]# cd/home/
[Email protected] home]# mkdir/home/warehouse-p
#上传windows本地maven仓库的jar包到这个目录下
[[email protected] warehouse]# ls
Aopalliance classworlds commons-beanutils commons-codec commons-io commons-logging javax log4j net Stax Xpp3
c3p0 com commons-cli commons-fileupload commons-lang dom4j junit mysql org xml-api S
[[email protected] warehouse]# ls Commons-io/commons-io/2.4/commons-io-2.4.jar
Commons-io/commons-io/2.4/commons-io-2.4.jar
#编译maven项目
[Email protected] warehouse]# cd/home/sourcecode/jy-cps-parent/jy-cps-mis/
[[email protected] jy-cps-mis]# mvn clean Install
[[email protected] jy-cps-mis]# ls
Doc pom.xml src Target
#最终会生成对应的war包
[[email protected] jy-cps-mis]# ls Target/jy-cps-mis-0.0.1-snapshot.war
Target/jy-cps-mis-0.0.1-snapshot.war
#关于maven私服的搭建与maven项目的介绍与部署请参考我的另两篇博文:
http://ylcodes01.blog.51cto.com/5607366/1771650
http://ylcodes01.blog.51cto.com/5607366/1774050
This article is from the "You can choose Extraordinary" blog, please be sure to keep this source http://ylcodes01.blog.51cto.com/5607366/1845228
Install SVN and MAVEN under Linux and rely on the MAVEN environment to package MAVEN projects