gpt4 book ai didi

java - Maven Javadoc 聚合在 JBoss AS 7.1.1.Final 上失败

转载 作者:行者123 更新时间:2023-12-02 06:44:06 24 4
gpt4 key购买 nike

我正在尝试使用 Maven Javadoc 插件为多个项目生成聚合 javadoc。如果我运行 javadoc:javadoc goal,构建就会成功完成。无论如何,我想将所有 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>

但运气不佳。感谢所有帮助!

最佳答案

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

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

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

另一种方法是使用 Artifact ID(而不是包名称)

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

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

关于java - Maven Javadoc 聚合在 JBoss AS 7.1.1.Final 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18822650/

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