天天看點

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

在eclipse中使用maven

① maven插件:eclipse内置

②maven插件的設定:

       [1]installations:指定maven核心程式的位置,不建議使用自帶的maven程式而應該使用自己解壓的那個

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

[2]user settings:指定conf/setting.xml的位置,進而擷取本地倉庫的位置

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

       ③基本操作

              [1]建立maven版的java工程

              [2]建立maven版的web工程

              [3]執行maven指令

建立項目,在new中找不到maven project時 參照以下配置

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

選擇Menu Visibilit-->File-->New 找到maven project 勾選,儲存

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

在eclipse中建立maven web工程

New -->maven project

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

Next

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

Finish

建立完成後

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

在main包下建立webapp檔案夾

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

右鍵項目,選擇properties-->Project Facets,勾選Dynamic Web Module

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

點選Further configuration available..進行配置

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

Context root的值不用修改,這個是我們的項目名稱

Context directory配置成,我們建立的webapp的路徑

勾選Generate web.xml deployment descriptor

然後确定就可以了

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

這些都是配置完成後生成的

然後在pom.xml中添加依賴

使用eclipse建立web項目的項目圖文步驟在eclipse中使用maven

繼續閱讀