documentation home

FAQ  Running Javadoc fails with Java 8


Problem

Running Javadoc with Java 8 on a project with custom Miredot Javadoc tags fails with the error "unknown tag".

Solution

Since Java 8 "unknown tag" has become an error instead of a warning. This can be fixed by adding Miredot tags to the configuration of the Javadoc process.

For maven:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
            <tags>
                <tag>
                    <name>summary</name>
                    <placement>a</placement>
                    <head>Miredot summary (resource title)</head>
                </tag>
                <tag>
                    <name>title</name>
                    <placement>a</placement>
                    <head>Miredot summary (resource title)</head>
                </tag>
                <tag>
                    <name>servicetag</name>
                    <placement>a</placement>
                    <head>Miredot resource tag (label)</head>
                </tag>
                <tag>
                    <name>statuscode</name>
                    <placement>a</placement>
                    <head>Miredot resource status code(s)</head>
                </tag>
                <tag>
                    <name>responseheader</name>
                    <placement>a</placement>
                    <head>Miredot response header</head>
                </tag>
            </tags>
        </configuration>
        <executions>
            <execution>
                <id>attach-javadocs</id>
                <goals>
                    <goal>jar</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

For gradle:

javadoc {
    source = sourceSets.main.allJava
    classpath = configurations.compile
    options.tags = [ "summary", "title", "servicetag", "statuscode", "responseheader" ]
}