0

我正在尝试使用 Maven Javadoc 插件为多个项目生成聚合 javadoc。如果我运行 javadoc:javadoc 目标,则构建以 SUCCESS 完成。无论如何,我想将所有 javadoc 与 javadoc:aggregate 目标结合起来,但在尝试查找 org.jboss.msc.service 包时失败:

org.apache.maven.reporting.MavenReportException: 
Exit code: 1 - /home/me/proj/proj/subproject1/src/main/java/com/test/hasingleton/HATimerServiceActivator.java:6: error: package org.jboss.msc.service does not exist
import org.jboss.msc.service.DelegatingServiceContainer;

如何配置 maven javadoc 插件以排除此导入?我尝试过以下设置:

<excludePackageNames>org.jboss.msc.service.*</excludePackageNames>
<dependencySourceExcludes>
     <dependencySourceExclude>org.jboss.msc.service:*</dependencySourceExclude>
</dependencySourceExcludes>

但没有运气。感谢所有帮助!

4

1 回答 1

2

您可以尝试这种方式(包括而不是排除)

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

          <dependencySourceIncludes>
            <!-- include ONLY dependencies I control -->
            <dependencySourceInclude>org.test.dep:*</dependencySourceInclude>
          </dependencySourceIncludes>
        </configuration>

其他方法是使用工件 ID(而不是包名称)

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

          <dependencySourceExcludes>
            <!-- exclude ONLY commons-cli artifacts -->
            <dependencySourceExclude>commons-cli:*</dependencySourceExclude>
          </dependencySourceExcludes>
        </configuration>
于 2013-09-16T07:56:59.377 回答