myeclipse建立maven項目

myeclipse已經集成maven。java

  1. 建立maven項目,file-->other-->maven

https://static.oschina.net/uploads/img/201610/31235404_xIl2.jpg

https://static.oschina.net/uploads/img/201610/31235545_mG3t.jpg

2.Maven,必須建立如下幾個Source Folderweb

src/main/resourcesapp

src/main/javaeclipse

src/test/resourceswebapp

src/test/javamaven

添加以上的Source Folder測試

https://static.oschina.net/uploads/img/201610/31235800_RuAg.jpg

在mian下添加ui

https://static.oschina.net/uploads/img/201610/31235906_eYLQ.jpg

https://static.oschina.net/uploads/img/201611/01000035_TTb5.jpg

3.設定4個文件夾的輸出Output folder,雙擊修改.net

https://static.oschina.net/uploads/img/201611/01000325_W5Hp.jpg

https://static.oschina.net/uploads/img/201611/01000350_AieE.jpg

分別修改輸出路徑爲圖片

src/main/resources  對應  target/classes

src/main/java  對應  target/classes

src/test/resources  對應  target/test-classes

src/test/java  對應  target/test-classes

4.將Libraries設置成本機jdk 還有將src/main/java up到最上邊

https://static.oschina.net/uploads/img/201611/01000911_ZJLB.jpg

https://static.oschina.net/uploads/img/201611/01000933_kLID.jpg

5.將項目轉換成Dynamic Web Project

在項目上右鍵Properties-->myeclipse-->Project Facers現將Dynamic Web Project 上的勾去掉 -->Apply應用一下讓後再打上勾 最下方出現further configuration 點擊

https://static.oschina.net/uploads/img/201611/01001425_RmXr.jpg

最下方出現further configuration 點擊 修改內容目錄Content directory 爲 src/main/webapp ,單擊OK:

https://static.oschina.net/uploads/img/201611/01001444_SLpA.jpg

https://static.oschina.net/uploads/img/201611/01001534_3SfP.jpg

6.設置部署程序集(Web Deployment Assembly)

在項目上右鍵單擊,選擇Properties,在左側選擇Deployment Assembly 去掉test 下資源包

https://static.oschina.net/uploads/img/201611/01001835_ls1e.jpg

上面設置部署時的文件發佈路徑以下

  1,咱們刪除test的兩項,由於test是測試使用,並不須要部署。   2,設置將Maven的jar包發佈到lib下。     Add -> Java Build Path Entries -> Maven Dependencies -> Finish

https://static.oschina.net/uploads/img/201611/01002035_zOGG.jpg

到此建立完成 作一遍基本就會

相關文章
相關標籤/搜索