Running AsciidoctorJ on WildFly

If you want to use AsciidoctorJ in an application deployed on WildFly, you have to follow the instruction below:

  1. Create an Asciidoctor module for WildFly.

  2. Create the following folder tree: $JBOSS_HOME/modules/org/asciidoctor/main.

  3. Create the module descriptor file module.xml.

    Asciidoctor module descriptor for WildFly
    <?xml version="1.0" encoding="UTF-8"?>
    <module xmlns="urn:jboss:module:1.0" name="org.asciidoctor">
            <resource-root path="asciidoctorj-api-3.0.0-alpha.1.jar"/>
            <resource-root path="asciidoctorj-3.0.0-alpha.1.jar"/>
            <resource-root path="jcommander-1.72.jar"/>
            <resource-root path="jruby-complete-"/>
            <module name="sun.jdk" export="true">
                    <include path="sun/misc/Unsafe" />
            <module name=""/>
            <module name="javax.api"/>
            <module name="org.slf4j"/>
  4. Copy the jar files into the same folder as the module.xml file.

  5. Make sure the version numbers of the jar files agree with what’s in the current set. Restart WildFly for the new module to take effect.

  6. Add a dependency on your Java archive to this WildFly module using one of the following options:

    1. Add the dependency just into the MANIFEST.MF file.

      MANIFEST.MF file example with dependency to Asciidoctor module
      Manifest-Version: 1.0
      Dependencies: org.asciidoctor
    2. Or, configure the dependency into the pom.xml with the Maven JAR/WAR plugin.

      pom.xml file example with Maven WAR plugin configuration to add a dependency
          <scope>provided</scope> (1)
                <Dependencies>org.asciidoctor</Dependencies> (2)
      1 The AsciidoctorJ dependency and the transitives dependencies don’t need to be added to the final WAR since all JARs are available through the module.
      2 The module dependency will be added to the MANIFEST.MF file.