2011年9月6日 星期二

How to add a Servlet to Maven Web App Project like Eclipse Dynamic Web One

1. Create a web app project with maven (mvn archetype:generate and choose maven-archetype-webapp)
1.1 Add a source folder: main/java
2. Right click on project and choose "Properties"
3. Click "Project Facets" at left pannel, Clicks "configures" at right , and choose "Dynamic Web Module"
4. You can add a Servlet like Eclipse Dynamic Web Project.

p.s. after choosing "Dynamic Web Module", you can find new folder "WebContent" like Eclipse Dynamic Web Project.
張貼留言