How to generate javadoc only one package

I will generate javadoc using NetBeans for only one specific package. If I click on the Generate Javadocs panel, I get the Javadoc of the entire project. Instead, I would use only one package.

+4
source share
2 answers

You can use the packagenames parameter for this. Syntax:

 javadoc [ options ] [ packagenames ] [ sourcefilenames ] [ -subpackages pkg1:pkg2:... ] [ @argfiles ] 

Documentation :

packagenames - A series of package names separated by spaces, for example java.lang java.lang.reflect java.awt. You must specify each package that you want to document separately. Wildcards are not allowed; the use of packaging for recursion. The Javadoc tool uses -sourcepath to search for these package names. See Example - Documenting One or More Packages.

You can apply these parameters to [Right Click on Project]> Properties> Build> Documenting, you can provide additional parameters, but when I need it, as you need now, I just did it manually (at the command line), I came to I conclude that netbeans provides the source package as a javadoc parameter.

+1
source

When using Netbeans 8.1:

  • [Right-click on the project]> Properties> Actions
  • Select the Create JavaDoc action
  • In "Set Properties:", specify: subpackages=<your package(s)>
  • Click OK

Now, to create a JavaDoc for this project, run the maven javadoc:javadoc target or run this target directly from Netbeans:

  • [Right click on project]> Create JavaDoc
0
source

All Articles