1

NetBeans generates Javadoc for all packages in the project. Adding the "-exclude" Javadoc option in the documentation form of the project properties under "Additional Javadoc Options" does not seem to work. How do I tell netBeans to exclude a specific package from the Javadoc?

pron
  • 13
  • 1
  • 3

2 Answers2

1

I would try edit -javadoc-build target in the ant build script. 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.

Ant fileset spec.

Community
  • 1
  • 1
Daniel Kec
  • 529
  • 2
  • 8
  • Thank you, that did the trick, though in a convoluted way. There really should be a UI for such a basic task. – pron Feb 21 '11 at 20:31
  • 3
    Modifying build-impl.xml is totally discouraged, as that file is automatically managed and changed by the IDE. Instead, override that target in the file build.xml (placed at the project's home folder), which will never be modified by the IDE. – manolowar Mar 31 '11 at 13:29
  • How do I modify the build.xml to exclude a package or file? – Another Compiler Error Mar 05 '14 at 14:59
  • please can anyone explain exactly how to override that file (buid-impl.xml) ? – pikimota Sep 24 '18 at 13:13
  • You can modify the `excludes=` line in `project.properties` instead of modifying `build-impl.xml`. This is somewhat less deprecated, and far less likely to break across Netbeans upgrades. It should be a directory list, that can include wildcards in the usual Ant format for attributes of the Fileset thing. – user207421 Jun 30 '20 at 04:19
0

Faced this for a Maven project (a Jenkins plugin) for which I imported a WSDL service.

The wsimport in JDK8 generates code that is not compatible with the JDK8 javadoc compiler.

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. The way to do this for a Maven project is by adding the following to the pom.xml.

    <plugins>

        <!-- ... -->

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