Search code examples
javaeclipsespringmaven-2m2eclipse

spring mvc test using eclipse and maven2


So I created a simple web app using maven, the pom.xml is setup in Eclipse just fine. I added apache commons, spring 3.0 as a dependancy.

I created a test controller using annotations, and a jsp file.

In eclipse, I only see a Run option, and no build option. With maven2 pom.xml setup etc., is just clicking on Run enough to build the project?


Solution

  • If you have m2eclipse installed and if your project is recognized as a "Maven project", then you should have more entries in the Run As... and Debug As... menus allowing to run a Maven build within Eclipse:

    alt text
    (source: theserverside.com)

    And if you don't have m2eclipse installed, either install it(!) or launch Maven as External Tools (but this won't provide "real" integration).