Thanks for answering Adam. I will make a Jira for this.
This is critical for our company since many of our systems are webapp suites that work together and in deployment are often in a single server. To closer simulate the production environment I would like to have them all in one Jetty instance. I have to make a solution for this so I will post the solution I come up with on the JIRA. I can't guarantee beauty for the first version but I can guarantee functionality. Hopefully that will be a good starting point. Vive le Gradle! Hope to see you at a Gradle seminar in the not too distance future. Jesse On Sat, Mar 20, 2010 at 2:55 AM, Adam Murdoch <[email protected]> wrote: > > > On 19/03/10 8:34 PM, Jesse Eichar wrote: > > This issue is quite important to me. Should I try to solve this using Ant? > It seems like that is possible (if difficult). Or is it possible with the > current Jetty plugin. I have seen hints that I can run several projects in > a single jetty instance but so far I am unable to determine how to do this. > > > Jetty itself can handle multiple web apps in a single instance, however, > the Gradle tasks don't provide a way to do this. It would definitely be a > good thing if they did. Could you add a JIRA issue for this? > > In the meantime, there's a few options you can use. > > 1. The simplest is to add extra JettyRunWar or JettyRun task instances, one > for each web app. This would run each web app in a separate jetty instance, > each with it's own http port. This may or may not be ok for what you need to > do. > > 2. With some contortions, you can get access to the jetty server instance > from the jetty task, and add the additional web apps programmatically. > > 3. Don't use the Gradle tasks, and use the jetty API directly from the > build script, for example: > > task runJetty << { > def server = new Server() > ... add the web apps > server.start() > } > > > Thank you, > > Jesse > > > >> Hi, > > >> I have the following situation > > >> project > > >> - /src/main/webapp > > >> - testapp > > >> I want to run both applications in the same Jetty instance with >> different contexts. I am looking at the JettyPlugin code and it appears >> like there should be a way to do this but I can't seem to understand how I >> should do it. I tried the following: > > >> apply id: 'war' > > >> apply id: 'jetty' > > >> task runAll(dependsOn: jettyRun, type: jettyRun.getClass()) { > > >> webAppSourceDirectory = file('testapp') > > >> } > > >> No luck. An acceptable solution would be to have 'testapp' be its own >> project (right now it is a single JSP page) and be built as a war file. >> Then the jetty could have one webapp as the war and the other as the normal >> application you get when running jettyRun. > > >> I have 2 requirements: > > >> 1. I need 2 separate applications > > >> 2. I need at least one of the two applications be scanned and the jetty >> auto-load the changes > > >> Any tips? > > > -- > Adam Murdoch > Gradle Developerhttp://www.gradle.org > >
