Getting Undertow
There are a few ways to get Undertow.
Wildfly
Since version 8.0 Undertow has been the web server component of Wildfly. If you are using Wildfly then you already have Undertow.
Maven
Undertow is built using maven, and is synced to maven central. Undertow provides three seperate artifacts:
- Core
-
Undertow core, which provides support for non blocking handlers and web sockets
- Servlet
-
Support for Servlet 4.0
- Websockets JSR
-
Support for the 'Java API for Websockets (JSR-356)' standard
In order to use Undertow in your maven projects just include the following section in your pom.xml, and set the undertow.version
property to whatever version of Undertow you wish to use. Only the core artifact is required, if you are not using
Servlet or JSR-356 then those artifacts are not required.
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
<version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-servlet</artifactId>
<version>${undertow.version}</version>
</dependency>
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-websockets-jsr</artifactId>
<version>${undertow.version}</version>
</dependency>
Direct Download
Undertow can also be directly downloaded from the maven repository.
Undertow depends on XNIO and JBoss Logging, which will need to be downloaded as well.
Build it yourself
In order to get the most up to date code you can build Undertow yourself.
Prerequisites
-
JDK8 or higher
-
Maven 3.1
-
git
Building Undertow is easy, just follow these steps:
- Configure Maven
-
Follow the instructions here to configure Maven to use the JBoss Maven repository.
- Clone the git repo
- Build Undertow
-
cd undertow && mvn install
The build should run all tests and complete without errors.
If you attempt to build with -Dmaven.test.skip=true for your initial build the build will fail, as the core test
jar will not be built and the Servlet module has a test scoped dependency on this jar. Either use -DskipTests , or
just let the tests run the first time.
|