简体   繁体   English

如何从 NetBeans 的 Javadoc 中排除特定包?

[英]How do I exclude a specific package from Javadoc in NetBeans?

NetBeans generates Javadoc for all packages in the project. NetBeans 为项目中的所有包生成 Javadoc。 Adding the "-exclude" Javadoc option in the documentation form of the project properties under "Additional Javadoc Options" does not seem to work.在“其他 Javadoc 选项”下的项目属性的文档形式中添加“-exclude”Javadoc 选项似乎不起作用。 How do I tell netBeans to exclude a specific package from the Javadoc?如何告诉 netBeans 从 Javadoc 中排除特定包?

I would try edit -javadoc-build target in the ant build script.我会尝试在 ant 构建脚本中编辑-javadoc-build目标。 On the Files tab browse your project and find nbproject/build-impl.xml , in this file find -javadoc-build target and replace ${excludes} variable in the fileset attribute called excludes with your desired package.在 Files 选项卡上浏览您的项目并找到nbproject/build-impl.xml ,在此文件中找到-javadoc-build target 并将名为excludes文件集属性中的 ${excludes} 变量替换为您所需的包。

Ant fileset spec. Ant 文件集规范。

Faced this for a Maven project (a Jenkins plugin) for which I imported a WSDL service.为我导入了 WSDL 服务的 Maven 项目(一个 Jenkins 插件)遇到了这个问题。

The wsimport in JDK8 generates code that is not compatible with the JDK8 javadoc compiler . JDK8 中的 wsimport 生成的代码与 JDK8 javadoc 编译器不兼容

Until this problem is fixed, one possible work-around is to generate these files to a separate package (which is good in any case), and exclude it from the javadoc generation.在解决此问题之前,一种可能的解决方法是将这些文件生成到一个单独的包中(这在任何情况下都很好),并将其从 javadoc 生成中排除。 The way to do this for a Maven project is by adding the following to the pom.xml.为 Maven 项目执行此操作的方法是将以下内容添加到 pom.xml。

    <plugins>

        <!-- ... -->

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
                <excludePackageNames>your.package.name</excludePackageNames>
            </configuration>
        </plugin>
    </plugins> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM