maven-javadoc-plugin not accepting <additionalparam>-Xdoclint:none</additionalparam>
Asked Answered
A

1

14

A mvn release:perform is failing due to javadocs not being created. So I tried running

mvn javadoc:javadoc

myself and I see that it fails due to the javadoc comments in the source code not having definitions for all of the parameters and return values. Errors are of the format:

Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.0.1:jar (attach-javadocs) on project my-project: MavenReportException: Error while generating Javadoc:

Exit code: 1 - /my/file.java:36: warning: no description for @return

This, however, used to work. So what changed?

I checked the maven-javadoc-plugin documentation and it now (in v3.0) says the parameter is not additionalParam, or additionalparam, but additionalOptions, and additionalJOptions. See maven-javadoc-plugin documentation.

When I searched for the parameter additionalParam, it does not appear. I'm confused how this could have worked. Searching for answers some people say to use what I'm using, others say to use additionalJOption. See Maven is not working in Java 8 when Javadoc tags are incomplete.

How can I fix it?

Any ideas on what caused the problem and how to fix it?

What I've tried

Luckily, I found a work around which was to disable the Javadoc linting from the command line:

mvn release:perform -Darugments="-Dmaven.javadoc.skip=true"

Kudo's to code.i-harness.com posting that gave me this work around.

So I'm passed the initial problem, but want/need to clean up the poms to remove useless parameters, or change them to the new/correct syntax (not yet tested).

Searches that were useful

Searching on SO gives these hits that were useful:

Amplification answered 28/9, 2018 at 2:3 Comment(0)
L
21

You should use the doclint option instead:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.0.1</version>
    <configuration>
        <doclint>none</doclint>
    </configuration>
</plugin>

This will skip all checks. Generally, I would recommend to run all checks except for missing @return and @param. So instead of none, you could use:

        <doclint>all,-missing</doclint>

Individual groups of checks can be switched on or off (like the -missing above). A detailed description of the groups can be found in the javadoc documentation (at the bottom of the page).

Luis answered 28/9, 2018 at 8:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.