Javadoc Processing

With Livedoc, it is possible to generate a documentation with almost no configuration, by directly reading descriptions from the relevant Javadoc.

This is possible thanks to the therapi-runtime-javadoc library, which allows Livedoc’s processor to include the Javadoc inside the classes at compile time, thus enabling access during the doc generation at runtime.

Enable Javadoc processing

To enable javadoc processing, you’ll need to add Livedoc’s javadoc processor on the processor classpath during the build of your project.

It can be done this way:

dependencies {
    annotationProcessor 'org.hildan.livedoc:livedoc-javadoc-processor:5.2.0'
}

Please note that the annotationProcessor configuration is only available in Gradle 4.6+. If you’re using a previous version, you should use the compileOnly configuration instead.

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
                <annotationProcessorPaths>
                    <annotationProcessorPath>
                        <groupId>org.hildan.livedoc</groupId>
                        <artifactId>livedoc-javadoc-processor</artifactId>
                        <version>5.2.0</version>
                    </annotationProcessorPath>
                </annotationProcessorPaths>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

Note: I’m no Maven expert, and I would appreciate any feedback about this annotation processing configuration using Maven.

This is all you need to do. Livedoc will then find the Javadoc and use it to get methods and parameter descriptions.