按包聚合 javadoc

Aggregate javadoc by packages

假设我有以下包结构:

当我生成 javadoc 时,我将在 index.html 下得到以下内容:

我觉得不方便有两个原因:

我想以某种方式“聚合”(或折叠?)包,以便我只能得到 com.company.framework,然后扩展它我只能得到 ab.

使用 Javadoc 可以实现吗?

我的设置(如果需要):

maven 插件:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
                <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                <overview>${basedir}/javadoc/overview.html</overview>
            </configuration>
            <executions>
                <execution>
                    <id>aggregate</id>
                    <goals>
                        <goal>aggregate</goal>
                    </goals>
                    <configuration>
                        <reportOutputDirectory>${basedir}/framework-doc/</reportOutputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>

我用来构建 javadoc 的命令:

mvn javadoc:aggregate

最后,寻找的正确位置是 javadoc maven 插件的 Grouping Packages 功能。

官方文档:here

样本:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
            <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
            <overview>${basedir}/javadoc/overview.html</overview>
            <groups>
               <group>
                   <title>Package A</title>
                   <packages>com.company.framework.a*</packages>
               </group>
            </groups>
        </configuration>
        <executions>
            <execution>
                <id>aggregate</id>
                <goals>
                    <goal>aggregate</goal>
                </goals>
                <configuration>
                    <reportOutputDirectory>${basedir}/framework-doc/</reportOutputDirectory>
                </configuration>
            </execution>
        </executions>
    </plugin>