unable to build maven project due to javadoc error?

With maven-javadoc-plugin version 3.0.0 <additionalparam/> has been replaced by <additionalOptions/>. To reduce the errors to warnings this pom.xml entry worked for me:

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <additionalOptions>
                    <additionalOption>-Xdoclint:none</additionalOption>
                </additionalOptions>
            </configuration>
        </plugin>
    </plugins>
</build>

UPDATE FOR THOSE WHO GOOGLED THIS BUG: If the project uses source/target 8, adding 8 in javadoc configuration should make the project buildable on jdk {11, 12, 13}:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
  <source>8</source>
</configuration>
 ...


I'm guessing you switched to Java 8. In this version Javadoc is stricter on the requirements.

You have three choices:

  1. Fix the errors
  2. disable the strict checking
  3. skip Javadoc when building

To disable the strict checking, add this to your pom.xml

<plugins>
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <configuration>
      <additionalparam>-Xdoclint:none</additionalparam>
    </configuration>
  </plugin>
</plugins>

to skip Javadoc while building, use this:

mvn -Dmaven.javadoc.skip=true verify

Further Information

Tags:

Maven

Javadoc