使用Maven / Eclipse进行开发时,可以一次运行两个webapp? [英] Possible to run two webapps at once when developing with Maven/Eclipse?

查看:161
本文介绍了使用Maven / Eclipse进行开发时,可以一次运行两个webapp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问题在于:我们为客户构建webapps。我们还有一个管理员webapp,可以修改一些客户端数据结构。由于数据的性质,两个webapp都必须在同一个JVM中运行。

Here's the problem: we build webapps for clients. We also have an "admin" webapp that modifies some client data structures. Because of the nature of the data, both webapps have to run in the same JVM.

这在生产中没有问题;你只需将两个webapp放在同一个应用程序服务器中。

This is no problem in production; you just put two webapps in the same app server.

我们最近改用Mavenish的方式来布局webapps,Maven想要每个项目一个webapp。在Eclipse中,这是一个问题,因为如果您独立运行不同的Web应用程序,它们将位于不同的JVM中。

We've recently switched to a Mavenish way of laying out webapps, though, and Maven wants one webapp per project. In Eclipse it's a problem, because if you run the different webapps independently, they'll be in separate JVMs.

我们正在尝试使用jetty-maven-plugin做webapp测试,但如果可以解决这个问题,可以切换到别的东西。

We're trying to use the jetty-maven-plugin to do webapp testing, but could switch to something else if it would solve this problem.

推荐答案

回答我自己的问题:

看来这是不可能的。我们提出的解决方法是编写一些嵌入式Jetty代码并从我们的应用程序中启动它。 Jetty允许您以编程方式添加多个Web应用程序。它还允许您创建多个资源库,即每个webapp的目录,从而启用叠加。到目前为止,它运作良好。

It appears that this just isn't possible. The workaround that we've come up with is to write a little embedded jetty code and launch it from within our app. Jetty allows you to add multiple webapps programmatically. It also allows you to create multiple resource bases, that is, directories, per webapp, which enables overlays. So far, it works great.

这篇关于使用Maven / Eclipse进行开发时,可以一次运行两个webapp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆