This example takes a normal WAR build, and wraps it into
a -thorntail
runnable jar.
Please raise any issues found with this example in our JIRA: https://issues.jboss.org/browse/THORN
This project is a traditional servlet project, with maven packaging
of war
in the pom.xml
<packaging>war</packaging>
The project adds a <plugin>
to configure thorntail-maven-plugin
to
create the runnable .jar
.
<plugin>
<groupid>io.thorntail</groupId>
<artifactId>thorntail-maven-plugin</artifactId>
<version>${version.thorntail}</version>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
To define the needed parts of Thorntail, a dependency is added
<dependency>
<groupid>io.thorntail</groupId>
<artifactId>undertow</artifactId>
<version>${version.thorntail}</version>
</dependency>
This project contains no Java code, simply resources to be served
statically from within the .war
You can run it many ways:
- mvn package && java -jar ./target/example-static-war-thorntail.jar
- mvn thorntail:run
- In your IDE run the
org.wildfly.swarm.Swarm
class
Since Thorntail apps tend to support one deployment per executable, it
automatically adds a jboss-web.xml
to the deployment if it doesn't already
exist. This is used to bind the deployment to the root of the web-server,
instead of using the .war
's own name as the application context.
http://localhost:8080/