Search code examples
javaweb-applicationsmavenmaven-jetty-plugin

Possible to run two webapps at once when developing with Maven/Eclipse?


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.

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

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.

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.


Solution

  • Answering my own question:

    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.