简体   繁体   English

使用Eclipse和Maven2进行Spring MVC测试

[英]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. 因此,我使用maven创建了一个简单的Web应用程序,在Eclipse中设置好pom.xml即可。 I added apache commons, spring 3.0 as a dependancy. 我添加了Apache Commons,春季3.0作为依赖项。

I created a test controller using annotations, and a jsp file. 我使用批注和一个jsp文件创建了一个测试控制器。

In eclipse, I only see a Run option, and no build option. 在Eclipse中,我只看到一个Run选项,而没有build选项。 With maven2 pom.xml setup etc., is just clicking on Run enough to build the project? 使用maven2 pom.xml设置等后,是否只需单击“运行”即可构建项目?

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: 如果您已安装m2eclipse, 并且您的项目被识别为“ Maven项目”,那么您应在“ 运行方式...”和“ 调试方式...”菜单中具有更多条目,以在Eclipse中运行Maven构建:

替代文字
(source: theserverside.com ) (来源: 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). 而且,如果没有安装m2eclipse, 请安装 (!)或将Maven作为外部工具启动(但这不会提供“真实的”集成)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM