Maven2 pom.xml for a webapp that works in Eclipse Europa+m2eclipse


/ Published in: Java
Save to your folder(s)

1. mvn archetype:create -DgroupId=deng -DartifactId=mywebapp -DarchetypeArtifactId=maven-archetype-webapp
2. Replace web.xml with http://snipplr.com/view/3800/minimal-webxml-webapp-descriptor-version-24
3. Replace pom.xml in this snipplet.
4. mvn eclipse:m2eclipse -Dwtpversion=1.5
5. Import project into Eclipse
6. In project properties > Java Build Path. Add a "Server Runtime" Library ( with Tomcat6)
7. In project properties > J2EE Module Dependencies. Check Maven2Dependencies
8. Project > Clean

If you re-importing a project back into Eclipse, be sure to:
1. Delete your existing project in eclipse
2. mvn clean eclipse:clean
3. Repeat steps 4-8 above.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.