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

2009年11月30日 星期一

BBEdit 9 Serial No

最近在找好用的 editor,有人在推薦 BBEdit

Download position
http://pine.barebones.com/demos/BBEdit_9.3_Demo.dmg

Serial Number
BEE900-EXBHG-ULLQL-VVHHT

from http://tungchingkai.blogspot.com/2009/11/bbedit-9-serial-no.html

2009年11月29日 星期日

install weblogic on mac os

安裝 weblogic 10 on snow leopard.

1. 下載 weblogic 10

http://www.oracle.com/technology/software/products/ias/htdocs/wls_main.html

Oracle WebLogic Server 10.3 - Package Installer : Generic: 473 MB

2. 下載 eclipse europa (eclipse version 3.3.2)

http://www.eclipse.org/downloads/packages/release/europa/winter

Eclipse IDE for Java EE Developers

3. 下載 eclipse wtp 2.0.3

http://archive.eclipse.org/webtools/downloads/index.php

把 plugin , features 複製到 eclispe 相關位置下。
針對 /eclispe/features/org.eclipse.wst.server_core.feature_2.0.2xxxxxxxxx/feature.xml 裡面的 2.0.2 改為 2.0.3

4. 做假檔案

weblogic 安裝的時候,會檢查 jdk(1.6),不過mac 下載的檔案及資料會不符合,安裝過程會失敗。
所以需要一些小技巧,需要 windows 系統下的 rt.jar, core.jar 放在 /System/Library/Frameworks /JavaVM.framework/Home/1.6/jre/lib/ ( rt.jar, core.jar 據說可以作假的空檔案)

5. install

>java -Dos.name=unix -jar server103_generic.jar
os.name 的目的是安裝過程中會檢查可用空間 可是不論有多大 都會檢查失敗,但是加了os.name=unix 就可以 pass