Maven默认的javadoc插件都会进行格式校验,正常情况下,很容易报错(MavenReportException: Error while generating Javadoc:),需要禁用其对应的格式检查。网上很多内容都写需要配置additionalparam参数为Xdoclint:none,但是其实3.X的插件参数名称已经发生了变化。
additionalparam需要替换成additionalJOption
也即是:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<encoding>UTF-8</encoding>
<aggregate>true</aggregate>
<charset>UTF-8</charset>
<docencoding>UTF-8</docencoding>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- <additionalparam>-Xdoclint:none</additionalparam> -->
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
</execution>
</executions>
</plugin>
网友评论