javadoc-plugin

2022-08-21 13:51:31 浏览数 (1)

我们可以使用maven-javadoc-plugin生成javadoc

代码语言:javascript复制
<!-- Javadoc -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.4.0</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

但如果我们有自定义标签或者新版标签,我们需要配置一个additionalOptions-Xdoclint:none

代码语言:javascript复制
<!-- Javadoc -->
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>3.4.0</version>
    <configuration>
        <additionalOptions>-Xdoclint:none</additionalOptions>
    </configuration>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

否则会因为MavenReportException: Error while generating Javadoc而中断生成

0 人点赞