在学习SpringMVC之前先将环境搭配好,现在通过使用Maven来管理这个Project.因此在Eclipse上创建一个Dynamic Web Project就必须要将其环境和操作步骤给出。
环境
1.JDK 1.5 or above
2. Eclipse 3.2 or above
3. Maven 2.0 or above
4. M2Eclipse Plugin
Step1: Create Maven Project In eclipse
Create a new project in Eclipse.
Go to File>New>Project.. and select Maven Project from the list.
Step2: Generate Eclipse Project with WTP
use maven command:
引用
mvn eclipse:eclipse -Dwtpversion=1.5
Go to the folder where the new project is created and excute above command.
Step3: Change Project Facet
The above step by default set the project facet to JDK 1.4. We need to modify this and set project facet to JDK 5. Right click on MavenWeb project and select Properties (shortcut: Alt+Enter). From the Properties dialog box, select Project Facets. Now click on “Modify Project…” button and change the project facet to Java 5.0
Step4: Setting Build Path
We need to specify the Maven jar dependencies in Java Build Path of our MavenWeb project. Open Properties.. dialog box (Alt+Enter) and select Java Build Path. Click “Add Library..” button and select “Maven Managed Dependencies” and click Finish.
以上四个步骤就可以成功创建Dynamic Web Project using Maven in Eclipse