2010年12月29日 星期三

use 中文 在 mac Terminal

ENV: sonw leopard.(10.6.5)

中文在 Terminal 下會是亂碼。
需要部分設定,才有辦法顯示中文。

1. open Terminal

2. command + ,

3. 在 tab 選擇 Advanced

4. 最下面的 international

character encoding --> UTF-8

2010年12月19日 星期日

install maven on mac

check maven install location:
/usr/share/maven

download latest version

cd /usr/share
sudo mv maven maven221
sudo cp -R /Users/xxxx/Downloads/apache-maven-3.0.1 maven

check version

sudo maven -version

2010年6月29日 星期二

maven multi module

1. create parent pom

$ mvn archetype:create -DgroupId=test.project -DartifactId=test-parent
$ cd test-parent
$ rm -r src
$ vi pom.xml

修改<packaging>jar</pachaging> 為 <packaging>pom</pachaging>

2. create module

test-parent$ mvn archetype:create -DgroupId=test.project.core -DartifactId=test-core
test-parent$ mvn archetype:create -DgroupId=test.project.web -DartifactId=test-web -DarchetypeArtifactId=maven-archetype-webapp
test-parent$ cd test-web
test-parent$ vi pom.xml

在 <build> 內加上

<plugins>
<plugin>
<groupid>org.mortbay.jetty</groupid>
<artifactid>maven-jetty-plugin</artifactid>
</plugin>
</plugins>

test-parent$ mvn jetty:run

3. open browser

http://localhost:8080/test-web/

2010年6月27日 星期日

fedora 文字安裝

最近安裝 fedora 13 到舊電腦上 (cpu pentium 800)
利用桌面的 install to hard drive 安裝,都沒有反應。
於是找到文字安裝模式
1. open terminal
Applications --> System tools --> Terminal

2. shell
>/usr/bin/liveinst -T

開始文字安裝。

2010年6月19日 星期六

maven(1)

Maven (http://maven.apache.org/index.html)

maven 是啥? 簡單來說可以稱為一個方便的』 build tool』 幫我們省去很多工作。包含Ant 會做的事: compile, 打包(packing), test(測試) , distribute(發佈)。另外可以跑報表, 生成 web site, 更有彈性的 team work.

透過POM (project object model)設定,就可以方便來管理專案


環境: JDK 6 , maven download(my version is 2.2.1)
下載完之後把 maven 加入path 底下 然後看一下版本
hint: 設定MAVEN_HOME 到你放maven 的位置 , MAVEN_HOME/bin 加入 path

2010年1月3日 星期日

Subversion on Mac os

一、Subversion

Subversion 是一個版本控管工具,在程式開發的時候,常用來進行控制版本間的差異。

二、Download

Subversion 有為了 mac 製作 dmg 的版本。
http://www.open.collab.net/downloads/community/

三,執行

執行完後,利用 terminal 來檢查。
> cd /opt/subversion

就會到 subversion 的目錄,接者把執行路徑加到 path 底下。
> cd ~/
> vi .bash_profile

export PATH=/opt/subversion/bin/:$PATH

退出後,檢查一下是否正確。
> svn help

四、建立 subversion 目錄

找一個位置當做 subversion repository

> cd ~/Documents
> mkdir subversion
> cd subversion
> svnadmin create svnrepo
> cd svnrepo

建立分類目錄
> mkdir project
> cd project

建立專案
> mkdir test
> touch test/test.txt

五、專案 check in svn

> svn import test file:///Users/cristo/Documents/subversion/svnrepo/project/test -m "init"

六、check out 專案

> svn checkout file:///Users/cristo/Documents/subversion/svnrepo/project/test test-copy
> cd test-copy

編輯 test.txt
> vi test.txt

檢查狀態
> svn status

check in
> svn commit -m "second"

六、 GUI 介面

可以試看看 svnX