一般專案裡一定有很多共用的lib,Maven可以方便的幫助使用者統一管理project共用的lib,因最近開發的專案陸續使用Maven的方式管理專案的lib,因此便把maven安裝了,以下安裝步驟
@有關Maven更詳細相關訊息可參考http://maven.apache.org/。
1. 下載maven,官方下載網站:http://maven.apache.org/目前最新版本,下載完後解壓縮到電腦裡。
2. 設定環境變數,新增M2_HOME,內容為解壓縮路徑。
3. 在Path裡增加%M2_HOME%\bin,完後切換cmd畫面輸入mvn -version,若成功即顯示maven版本。
4. 開啟在 maven安裝目錄下conf/setting.xml檔,找尋到設置資源庫位置:(localRepository標籤)
Windows 7:
C:\Users\danny.yu\.m2\repository
danny.yu視使用者名稱設定。
若開發環境設置於防火牆下,可嘗試透過 proxy 進行檔案下載:
<settings>
. . .
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
</proxy>
</proxies>
. . .
</settings>
6. 安裝 subclipse:
eclipse => Help => Install New Software =>輸入 http://subclipse.tigris.org/update_1.8.x => 全部安裝
10. eclipse => preferences => maven => installations => add => 擇maven解壓縮位置=>下方 Global settings from installation directory 會變成 解壓縮位置之 settings.xml。
11. eclipse => preferences => maven => User Settings => User Settings =>選擇解壓縮位置之settings.xml,下方之 Local Respository不予更動。
12. 測試:
maven 專案上右鍵=>Run As=>Maven clean,正確結果:[INFO] BUILD SUCCESS 。
maven 專案上右鍵=>Run As=>Maven install,正確結果:[INFO] BUILD SUCCESS。
@有關Maven更詳細相關訊息可參考http://maven.apache.org/。
1. 下載maven,官方下載網站:http://maven.apache.org/目前最新版本,下載完後解壓縮到電腦裡。
2. 設定環境變數,新增M2_HOME,內容為解壓縮路徑。
3. 在Path裡增加%M2_HOME%\bin,完後切換cmd畫面輸入mvn -version,若成功即顯示maven版本。
4. 開啟在 maven安裝目錄下conf/setting.xml檔,找尋到設置資源庫位置:(localRepository標籤)
Windows 7:
C:\Users\danny.yu\.m2\repository
danny.yu視使用者名稱設定。
若開發環境設置於防火牆下,可嘗試透過 proxy 進行檔案下載:
<settings>
. . .
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>proxy.somewhere.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
</proxy>
</proxies>
. . .
</settings>
5. 在eclipse 裡安裝 maven :
eclipse => Help => Install New Software => 選擇 m2e 開頭的東西全部安裝
6. 安裝 subclipse:
eclipse => Help => Install New Software =>輸入 http://subclipse.tigris.org/update_1.8.x => 全部安裝
10. eclipse => preferences => maven => installations => add => 擇maven解壓縮位置=>下方 Global settings from installation directory 會變成 解壓縮位置之 settings.xml。
11. eclipse => preferences => maven => User Settings => User Settings =>選擇解壓縮位置之settings.xml,下方之 Local Respository不予更動。
12. 測試:
maven 專案上右鍵=>Run As=>Maven clean,正確結果:[INFO] BUILD SUCCESS 。
maven 專案上右鍵=>Run As=>Maven install,正確結果:[INFO] BUILD SUCCESS。






留言