Ingvald
Ingvald

Reputation: 443

Tapestry webapp with embedded Jetty

How can I configure a Tapestry5 project to run standalone (via java -jar) with embedded Jetty?

I'm looking for a short "recipe" regarding Tapestry5, Jetty, configuration of servlets/ handlers/ whatever is needed to connect the dots...

I've seen a few dots: How to Create an Executable War, Configuring Tapestry (ref Tapestry as servlet filter)

Edit: I'm thinking about a standalone running webapp due to server circumstances. It doesn't have to be embedded Jetty, but I can't rely on a stable appserver. Still looking for a recipe, though, so I don't spend much time on dead ends...

Also, I'd like for Jenkins (Hudson) to be able to stop and start the server automatically when deploying updates - I don't know if that influences what I can do with Jetty, f.ex.

Upvotes: 0

Views: 1399

Answers (3)

Ingvald
Ingvald

Reputation: 443

I did some digging, and this is the short recipe I basically ended up following:

  1. Start with the Maven Jetty plugin as configured in the pom.xml of the Tapestry 5 archetype
  2. Add the stopKey and stopPort attribute to Maven Jetty plugin configuration
  3. Let Jenkins CI run maven target jetty:stop and then clean install
  4. Let Jenkins run shell script mvn jetty:run &

Voila - my Java app is up and running with automatically updated code, without any appserver.

Upvotes: 0

Andreas Andreou
Andreas Andreou

Reputation: 1332

Well, i believe this is a general "how to run a war question". Assuming you indeed have a war, you can use jetty or winstone to "run" it - see :

http://winstone.sourceforge.net

and

http://www.enavigo.com/2008/08/29/deploying-a-web-application-to-jetty/

In the first case, you can directly do

java -jar winstone.jar --warfile=<warfile>

Upvotes: 3

Related Questions