使用Maven进行在线开发的标准方式
我最近开始学习 Maven,我的问题是关于在 Web/应用程序服务器上部署 Web 应用程序的标准方法。
我能够为使用 spring 和 mysql 的简单 Web 应用程序创建 war 文件。我想在服务器上部署相同的内容并测试该应用程序。我可以看到一些提到用于应用程序部署的 Jetty 的文档/文章。我还看到了一些有关用于应用程序部署的 Tomcat 的文档。
我想知道,使用Maven开发应用程序时通常使用哪个服务器?
I've recently started learning about Maven and my question is about standard ways for deploying my web application on a web/app-server.
I am able to create war file for a simple web application that uses spring and mysql. I would like to deploy the same on server and test the application. I could see some documents/articles that mention about Jetty
for application deployment. I also saw some documentation that talks about Tomcat
for application deployment.
I would like to know, which server normally is used while developing application with Maven?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Tomcat 和 Jetty 都有多种方式允许开发人员在其上部署应用程序。虽然我自己没有使用过这个,但很多人都推荐了 Cargo,正如你所看到的,不仅支持 Jetty/Tomcat,还支持许多其他 Web 容器(并且不仅通过 Maven)。
如上所述,您可能应该根据其他标准(功能/速度/RAM消耗/社区/krosenvold提到的其他事情)来选择服务器。人们之前已经讨论过:
我们使用 Tomcat 主要是因为几年前有人做出了这个决定,并且有 切换到其他内容的小要点。
Both Tomcat and Jetty have multiple ways allowing developers to deploy applications on them. And although I haven't used this myself, many people have recommended Cargo which, as you can see, supports not only Jetty/Tomcat but many other web containers (and not only via Maven).
Above said, you should probably choose server based on other criteria (features / speed / RAM consumption / community / other things mentioned by krosenvold). People have already discussed that here before:
We use Tomcat mainly because somebody did this decision years ago and there's little point to switch to something else.
两者都可以使用,并且没有这样的“标准”,但它们有一些关键的区别:
Jetty 传统上对嵌入到您自己的代码中提供更好的支持(从代码开始,例如测试),尽管我听说这个Tomcat 7 中变得更好。Jetty 可能是两者中最快的,而 Tomcat 具有更高的标准合规性。如果您的应用程序要在生产中的不同应用程序服务器上运行,Tomcat 可能是最佳选择。
Both can be used, and there is no "standard" as such, but they have a few key differences:
Jetty has traditionally had better support for embedding within your own code (starting from code, for instance a test), although I hear this has gotten better in Tomcat 7. Jetty is probably the fastest of the two, while Tomcat has much higher standards compliance. If your application is to be run on a different applications server in production, Tomcat is probably the best choice.
您可以使用 Maven Tomcat 插件 部署到 Tomcat。
You can use the Maven Tomcat plugin for deploying to Tomcat.