我有一组我正在生成javadoc的类,其中一些我想从已发布的javadoc中排除。结构如下:
com.company.package.classA
com.company.package.classB
com.company.package.subpackage.classC
com.company.package.subpackage.classD
我想排除“package”中的所有类,并在“subpackage”中包含所有类。设定:
<excludePackageNames>com.company.package</excludePackageNames>
排除了包装下的所有子包。
除了重组代码之外,有没有办法做到这一点?
答案 0 :(得分: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>