1. Import Maven web project.
2. MAVEN => Update Pproject Configuration
3. project Properties => Project facets => convert to faceted form => select "dynamic web module" => click "further configuration available", change the 'content directory to your current folder, like 'src \ main \ webapp'
4. Make sure Maven dependencies embedded during run on Tomcat 7 by: Project Properties => deployment Assembly => Add => "Maven dependencies"
Run on server now will work.
Take care about the maven dependency issue, here is a solution for it.
Http://stackoverflow.com/questions/6083501/maven-dependecies-not-visible-in-web-inf-lib
- You shoshould invoke
mvn
package
(Or right-click> Maven> package) and obtain a war file-<packaging>
(In
The POM) must bewar
- Your dependencies shocould be with the default scope (if they are
provided
Ortest
They
Will not be encoded in the archive)
- If you are running the project as dynamic web project on a server within eclipse, then you shoshould open the project properties (right click> Properties) and select "deployment assembly ". there click "add", select "build path entries", and choose "Maven dependencies ".
This will instruct WTP to send the maven dependencies to the server dir.
Also, you can use run as in eclipse. Create a Maven build use goal "Tomcat: Run"