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