gpt4 book ai didi

maven - 我可以使用Maven JavaDoc插件(2.7版)excludePackageNames属性排除软件包,但不排除其子软件包吗?

转载 作者:行者123 更新时间:2023-12-05 01:19:09 24 4
gpt4 key购买 nike

我有一组要为其生成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>


排除包下面的所有子包。

除了重组代码之外,还有什么办法可以做到这一点?

最佳答案

您可以使用
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>

关于maven - 我可以使用Maven JavaDoc插件(2.7版)excludePackageNames属性排除软件包,但不排除其子软件包吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11404618/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com