I want to develop a Java Web application with a similar architecture to Jenkins. It shall ship with an embedded server, so that it can be started like

java -jar myapp.war

We are using Jenkins for a while now and I really like this aspect from my user's perspective.

Additionally I want to make several aspects of the application pluggable. Like user-management, authentication or reports. I mention this, as this may render the support for OSGI useful.

Other features I would like the server to have are

  • support for web sockets
  • support for SPDY

Aside of this I'd like the server to

  • have an active community
  • being open source is a plus

Currently I am tending towards Jetty. I also had a quick glance at Winstone, as it is the server that ships with Jenkins, but the later appears to be not developed further.

I am slightly aware of other servers, like Apache Felix or the possibility to embed Apache Tomcat, but I am rather inexperienced running these servers embedded.

  • 1
    Spring Boot framework have embbeded Tomcat, very easy to use. Feb 6 '14 at 7:53
  • 2
    How should I improve the question to meet the standards?
    – cheffe
    Feb 6 '14 at 9:39

As the other answerer I would recommend Jetty because you want you application to be lightweight in case someone decides to deploy your application manually. There is a nice Maven plugin for that purpose that does all the work: http://simplericity.com/2009/11/10/1257880778509.html It really works out of the box by my experience and the link describes some switches you can determine in the POM for making the executable.

It even comes with a GUI which you can however supress.

  • I decided to go with Jetty.
    – cheffe
    Feb 19 '14 at 7:38

I have used Jetty for this. It is nonaweful. I find it more awkward than the equivalent tools for python.

It definitely is open source, and it is used in industry. Which is important.

(I don't have much to add, but if a friend came to me and said: "I want a embedded a webserver in a java program, I would tell them to use Jetty.")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.