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

时间:2020-09-23 17:50:07

标签: maven maven-3 maven-javadoc-plugin

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

  <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>

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

那么如何完成我的请求?

0 个答案:

没有答案
相关问题