buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Spiewak <djspie...@gmail.com>
Subject Re: How to run a webapp in jetty
Date Sat, 14 Feb 2009 01:04:44 GMT
Nathan Hamblin has created a Buildr extension which accomplished  
this.  I don't have a URL handy, but he did publish it in a JavaWorld  
article.

Daniel

On Feb 13, 2009, at 6:37 PM, Martin Grotzke <martin.grotzke@javakaffee.de 
 > wrote:

> Hi,
>
> I have a simple webapp and want to run this with jetty.
>
> Just running "buildr jetty:start" (with require 'buildr/jetty' in my
> buildfile) starts jetty, but then jetty doesn't serve my webapp.
>
> From the ode buildfile I found the following:
>
>  task("start"=>[package(:war), jetty.use]) do |task|
>    class << task ; attr_accessor :url, :path ; end
>    task.url = "http://localhost:8080/mywebapp"
>    task.path = jetty.deploy(task.url, task.prerequisites.first)
>    jetty.teardown task("stop")
>  end
>
>  task("stop") do |task|
>    if url = task("start").url rescue nil
>      jetty.undeploy url
>    end
>  end
>
> It seems that I can invoke this with "buildr  
> mywebapp:start" ("mywebapp"
> beeing the name I defined for my project). I see jetty starting my
> webapp, but unfortunately it stops directly afterwards. This is the  
> end
> of the output:
>
> ====================
> [Completed] Your build has completed: /home/grotzke/proj/mywebapp
> buildr mywebapp:start
> Completed in 2.625s
> Undeploying app at /mywebapp
> Jetty server stopped
> ====================
>
> So what is the correct way to run jetty with the deployed webapp?
>
> Thanx in advance,
> cheers,
> Martin
>
>

Mime
View raw message