正确的maven-javadoc-plugin 3.2.0配置以生成所有子模块的根javadoc

问题描述

对于单个模块,我可以做到以下几点:

  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <show>private</show>
            </configuration>
        </plugin>
    </plugins>
  </build>

在具有与上述相同配置的 multi 模块项目的其他工作区中,但是为每个模块生成了Javadoc。

我需要的全部都合并到了根项目中。我读了以下内容

因此我添加了:

   <reportSets>
      <reportSet>
        <id>aggregate</id>
        <inherited>false</inherited>
        <reports>
          <report>aggregate</report>
        </reports>
      </reportSet>
      <reportSet>
        <id>default</id>
        <reports>
          <report>javadoc</report>
        </reports>
      </reportSet>
    </reportSets>

观察是强制性的,将插件<build>移至<reporting>,否则会出现错误

因此:

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
                <source>1.8.</source>
                <target>1.8</target>
                <show>private</show>
            </configuration>
            <reportSets>
                <reportSet>
                    <id>aggregate</id>
                    <inherited>false</inherited>
                    <reports>
                        <report>aggregate</report>
                    </reports>
                </reportSet>
                <reportSet>
                    <id>default</id>
                    <reports>
                        <report>javadoc</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
    </plugins>
</reporting>

但是,发生的行为与单个模块相同。

那么如何完成我的请求?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)