Failed to load latest commit information.

MicroProfile .war Example

This example takes a normal[MicroProfile] WAR, and wraps it into a -swarm runnable jar.

Please raise any issues found with this example in our JIRA:

Project pom.xml

This project is a traditional WAR project, with maven packaging of war in the pom.xml


The project adds a <plugin> to configure wildfly-swarm-plugin to create the runnable .jar.


To define the needed parts of WildFly Swarm, a dependency is added


This dependency provides the APIs that are part of the MicroProfile to your application, so the project does not need to specify those.

Additional application dependencies (in this case joda-time) can be specified and will be included in the normal .war construction and available within the WildFly Swarm application .jar.


  • mvn package && java -jar ./target/example-microprofile-war-swarm.jar
  • mvn wildfly-swarm:run
  • From your IDE, run class org.wildfly.swarm.Swarm


Since WildFly Swarm 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.


Be aware that you will notice an exception in the logs when accessing the page. This is simply an overly verbose message from WildFly that the 'favicon.ico' file couldn't be found.