ubuntu下maven安裝

1. 安裝windows 端 maven 

http://maven.apache.org/download.cgi?Preferred=http%3A%2F%2Fapache.etoak.com%2F
需要設置環境變量

2. ubuntu 下安裝svn服務器

1. 安裝svn
sudo apt-get install subversion
2. 開啓svn服務器
svnserve -d
檢查是否開啓:ps aux | grep svnserve
若出現如下內容:
wkr 6537 0.0 0.0 13784 956 ? Ss 16:18 0:00 svnserve -dwkr 7593 0.0 0.0 5784 864 pts/0 S+ 21:57 0:00 grep –color=auto svnserve
表示服務已開啓。(注意:一定要有第1行,只有第2行說明服務未啓動)
3. 建立倉庫
svnadmin create /var/svnrepos/repos1 理論上,倉庫可以建立在任何目錄中。
4. 修改配置文件
編輯 svnserve.conf
gedit /var/svnrepos/repos1/conf/svnserve.conf
 把anon-access = read,auth_access = write和password-db = passwd,authz-db = authz 的註釋去掉,還有[general]的註釋也要去掉(這個默認沒有註釋)。 注:當你去掉註釋的時候,不要簡單的把前面的#去掉,要把前面的空格一塊去掉,不然在Eclipse中使用的時候會出現配置文件格式錯誤的問題。
5. 修改帳戶文件
gedit /var/svnrepos/repos1/conf/passwd
### This file is an example password file for svnserve.### Its format is similar to that of svnserve.conf. As shown in the### example below it contains one section labelled [users].### The name and password for each user follow, one account per line.
[users]# harry = harryssecret# sally = sallyssecretuser1 = pass1  # 輸入你定義的用戶名和密碼,密碼顯然沒有加密
6. 修改授權文件
gedit /var/svnrepos/repos1/conf/authz
修改或者輸入下面2行:
[repos1:/]user1 = rw
其中,repos1是倉庫名稱,user1是用戶名,rw代表讀寫。
7. svn開機自啓動
進入/etc/init.d/目錄
cd /etc/init.d/
創建/編輯svnd腳本文件
sudo gedit svnd
#!/bin/bash# chkconfig: 34 30 70# description: svnserve startup
if [ ! -f "/usr/bin/svnserve" ]thenecho “svnserve startup: cannot start: file /usr/bin/svnserve doesn’t exists or cannot access.”exitficase “$1″ instart)echo “Starting svnserve…”/usr/bin/svnserve -d –root /path/to/svnrepos 【2012.3.17補充下劃線部分】echo “started.”;;stop)echo “Stoping svnserve…”killall svnserveecho “stopped”;;restart)$0 stop$0 start
;;*)echo “Usage: sudo service svnd {start|stop|restart}”exit 1esac
執行下面命令,svnserve即可開機自啓動
sudo chmod a+x /etc/init.d/svnd
sudo chkconfig –add svnd
更多有關ubuntu註冊服務和開機自啓動的內容請參考ubuntu註冊服務

8. 啓動具體倉庫

啓動Subversion服務器 對於單個代碼倉庫,啓動命令:

svnserve -d -r /var/svn --listen-host 10.19.3.103 
其中 /var/svn爲maven倉庫位置, 後面host爲svn服務器地址。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章