3

javadoc を生成する一連のクラスがあり、そのうちのいくつかは、公開された javadoc から除外したいと考えています。構造は次のとおりです。

com.company.package.classA
com.company.package.classB
com.company.package.subpackage.classC
com.company.package.subpackage.classD

「パッケージ」内のすべてのクラスを除外し、「サブパッケージ」内のすべてのクラスを含めたい。設定:

<excludePackageNames>com.company.package</excludePackageNames>

package の下のすべてのサブパッケージを除外します。

コードを再構築する以外に、これを行う方法はありますか?

4

1 に答える 1

1

maven-javadoc-pluginを使用 してそれを行うことができます。

これは、バージョン 2.7 以降でサポートされています。

例:

<plugin>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.8.1</version>
    <executions>
      <execution>
        <id>javadoc-jar</id>
        <phase>package</phase>
        <goals>
          <goal>jar</goal>
        </goals>
        <configuration>
          <!-- switch on dependency-driven aggregation -->
          <includeDependencySources>true</includeDependencySources>

          <dependencySourceExcludes>
            <!-- exclude ONLY commons-cli artifacts -->
            <dependencySourceExclude>commons-cli:*</dependencySourceExclude>
          </dependencySourceExcludes>
        </configuration>
      </execution>
    </executions>
  </plugin>


     <configuration>
          <!-- switch on dependency-driven aggregation -->
          <includeDependencySources>true</includeDependencySources>

          <dependencySourceIncludes>
            <!-- include ONLY dependencies I control -->
            <dependencySourceInclude>org.test.dep:*</dependencySourceInclude>
          </dependencySourceIncludes>
     </configuration>
于 2012-07-12T08:59:35.507 に答える