1、下載并解壓zip到你自己指定的目錄
2、檢查是否設定了JAVA_HOME,然后設定MAVEN_HOME為安裝目錄和Path=%MAVEN_HOME%\bin。
3、將lib\maven.jar 解壓縮,修改其中的default.properties文件中的幾個屬性。
maven.home.local = d:/maven
maven.repo.local = d:/maven/repository
## ----------------------------------------------------------
## ${user.home}/build.properties
## ----------------------------------------------------------
maven.proxy.host = proxy
maven.proxy.port = 80
maven.proxy.username = username
maven.proxy.password = password
4、maven使用時會出現(xiàn)亂碼,這是由于maven.jarorg\apache\maven\messages\messages_zh_CN.properties這個文件的毛病。
native2ascii進行轉換,然后重新覆蓋此文件即可。
5、運行maven命令,即可生成一系列的文件
6、運行maven genapp 即可生成測試文件,自動下載文件,然后就可以 maven java:compile了。
7. default.properties中遠程repository重新設置: maven.repo.remote = http://apache.linuxforum.net/dist/java-repository,http://dist.codehaus.org/,http://mirrors.sunsite.dk/maven/,http://public.planetmirror.com/pub/maven,http://www.ibiblio.org/maven,http://www.ganet.org/maven/,http://test.topicus.nl/maven/
maven tutorial :
http://www-900.ibm.com/developerWorks/cn/java/j-maven/
http://www.theserverside.com/articles/article.tss?l=MavenMagic
使用中如果有問題,可以參考下面文章. :) http://java.mblogger.cn/layout/posts/5731.aspx
但我下載的源代碼和原文"Figure 3 "的目錄結構不一致, 只有三個目錄:service, Foobar-Web,ear. 執(zhí)行結果不正確.
我分別在這三個目錄下,分別執(zhí)行maven, 前兩個已經(jīng)完成,但是在ear目錄下執(zhí)行maven命令,則報錯如下:
"Case-sensitive issue: The dependency xerces:xerces has a case problem. The dependency was either retrieved in the past with the wrong case or has been specified with the wrong case in your project.xml file. Fix your project.xml or update your local repository with the properly-cased file and try again."
讓人郁悶的是, 我把repository里面的xerces目錄刪除,還是只可以完成前兩步,第三步報同一個錯誤.
我將每個depency的properties元素刪除,就可以了 sucessful :(
可以請教一下么?