Pat*_*atS 9 maven maven-javadoc-plugin
A mvn release:perform is failing due to javadocs not being created. So I tried running
mvn javadoc:javadoc
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
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.
Any ideas on what caused the problem and how to fix it?
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"
Run Code Online (Sandbox Code Playgroud)
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).
Searching on SO gives these hits that were useful:
How can I disable the Maven Javadoc plugin from the command line? - Gave me the idea to search for maven.javadoc.skip which helped me find my work around.
Maven is not working in Java 8 when Javadoc tags are incomplete which says I should use additionalJOption parameter. The same question has an answer that says to use what I'm using <additionalparam>-Xdoclint:none</additionalparam>
gjo*_*anv 12
您应该改用doclint选项:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<doclint>none</doclint>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
这将跳过所有检查。通常,我建议运行所有检查,除了缺少 @return 和 @param。因此none,您可以使用:
<doclint>all,-missing</doclint>
Run Code Online (Sandbox Code Playgroud)
可以打开或关闭各个检查组(-missing如上所述)。可以在javadoc 文档(在页面底部)中找到这些组的详细描述。
| 归档时间: |
|
| 查看次数: |
3513 次 |
| 最近记录: |