使用eclipse和maven2进行spring mvc测试

发布于 2024-08-21 01:01:51 字数 217 浏览 5 评论 0原文

所以我使用 maven 创建了一个简单的 Web 应用程序,pom.xml 在 Eclipse 中设置得很好。 我添加了 apache commons、spring 3.0 作为依赖项。

我使用注释创建了一个测试控制器和一个 jsp 文件。

在 Eclipse 中,我只看到“运行”选项,没有看到“构建”选项。通过 maven2 pom.xml 设置等,只需单击“运行”就足以构建项目吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

合约呢 2024-08-28 01:01:51

如果您安装了 m2eclipse 并且如果您的项目被识别为“Maven 项目”,那么您的“运行方式”中应该有更多条目。 和 调试为... 菜单允许在 Eclipse 中运行 Maven 构建:

. sstatic.net/9QYKi.gif" rel="nofollow noreferrer">alt text
(来源:theserverside.com)

如果您没有安装 m2eclipse,请安装它(!) 或将 Maven 作为外部工具启动(但这不会提供“真正的”集成)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文