Run Javadoc with the org.asciidoctor.Asciidoclet doclet class. Some examples for common build systems are shown below. See Doclet Options for supported options.


Asciidoclet may be used via a maven-javadoc-plugin doclet:

          --base-dir ${project.basedir}
          --attribute "name=${}"
          --attribute "version=${project.version}"
          --attribute "title-link=[${} ${project.version}]"


Asciidoclet may be used via a doclet in the Javadoc task:

configurations {

dependencies {
    asciidoclet 'org.asciidoctor:asciidoclet:1.+'

javadoc {
    options.docletpath = configurations.asciidoclet.files.asType(List)
    options.doclet = 'org.asciidoctor.Asciidoclet'
    options.overview = "src/main/java/overview.adoc"
    options.addStringOption "-base-dir", "${projectDir}" (1)
    options.addStringOption "-attribute", (2)
            "name=${}," +
            "version=${project.version}," +
            "title-link=[${} ${project.version}]")
1 Option names passed to Gradle’s javadoc task must omit the leading "-", so here "-base-dir" means "--base-dir". See Doclet Options.
2 Gradle’s javadoc task does not allow multiple occurrences of the same option. Multiple attributes can be specified in a single string, separated by commas.


Asciidoclet may be used via a doclet element in Ant’s javadoc task:

<javadoc destdir="target/javadoc"
  <doclet name="org.asciidoctor.Asciidoclet" pathref="asciidoclet.classpath"> (1)
    <param name="--base-dir" value="${basedir}"/>
    <param name="--attribute" value="name=${}"/>
    <param name="--attribute" value="version=${version}"/>
    <param name="--attribute" value="title-link=[${} ${version}]"/>
1 Assumes a path reference has been defined for Asciidoclet and its dependencies, e.g. using Ivy or similar.

Currently, there is an intermittent benign warning message that is emitted during a run of Asciidoclet stating the following:

WARN: tilt autoloading 'tilt/haml' in a non thread-safe way; explicit require 'tilt/haml' suggested.

Unfortunately, until the underlying library removes this warning message, it will be logged during the build.