Skip to content
Rune Peter Bjørnstad edited this page Apr 27, 2015 · 6 revisions

The Embedded Jetty utility is a Jetty-server bootstrapper that simplifies how a J2EE application can be deployed. It builds on experiences from Shared Server and reduces the number of required Maven modules to one!

In a traditional J2EE setup you deploy your Web and Enterprise archived to a J2EE Application server, like the following figure demonstrates:

The J2EE Application server can be from the large vendors, like Oracle WebLogic and IBM WebSphere, or Open Source alternatives like Tomcat, Jetty and Glassfish. Common for all these solutions are that the J2EE server is a deployment unit of its own, which needs its own configuration.

For quite a few years now a more lightweight way of deploying J2EE applications have gained traction. Instead of having the J2EE application server as a separate deployment unit, the server is instead embedded in the application. Whenever the application (WAR-file) is built, the J2EE server is embedded as well. The application is started from a simple main-method. This has several advantages, but the main one is that development becomes much easier since you run the J2EE server in the same context as the application. Debugging, for example, becomes much easier. No need for remote debugging. It can all be done from within the IDE itself.

This project, the Embedded Jetty Builder, let you take it a step further - you no longer need to assemble WAR archives. This makes it possible to deliver simple single-module projects, without reverting to an uber-JAR approach.

Getting started

We've created a sample project that can get you started using Embedded Jetty.

See https://github.com/NetsOSS/embedded-jetty-sample

Versioning

The artifact version number tracks the Jetty version, e.g. 1.0+9.0 tracks the 9.0.x versions of Jetty.

Patch strategy

Patches are generally created on the oldest applicable Jetty version and merged or cherry picked to the future versions.

JSP

To enable JSP support add these dependencies to your project:

<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>apache-jsp</artifactId>
  <version>${jetty.version}</version>
</dependency>
<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>apache-jstl</artifactId>
  <version>${jetty.version}</version>
</dependency>

The jetty-annotations jar is also required:

<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-annotations</artifactId>
  <version>${jetty.version}</version>
</dependency>

  • Release 1.1+9.1
  • Snapshot 1.2+9.2-SNAPSHOT
Clone this wiki locally