0
votes

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.

3
You can be a bit more specific about what you're trying to achieve. You don't have to use an embedded Jetty. You could simply package an entire Jetty with your app in the appropriate directory and use an installer to put some scripts in the correct spots.leonm
thanks - modified the question.Ingvald
Thanks for your input - the recipe I posted below seemed to be the simplest way of getting a standalone server up and running, with Jenkins able to restart it.Ingvald
Regarding tags, it seems removing the tapestry and embedded-jetty tag and adding a jenkins tag would be more appropriate.Ingvald

3 Answers

3
votes

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>
0
votes

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.