Home > Blockchain >  Can I javadoc a whole Java project from the command line without explicitly naming packages?
Can I javadoc a whole Java project from the command line without explicitly naming packages?

Time:05-02

I have a java codebase with many packages which I'm not that familiar with.

I just want to get an overview by javadoc-ing the while thing. Without having to specify the names of which packages I want to document. I just want "everything"

Is there a simple command line option for this?

Update :

I would have just expected to be able to write something like

javadoc -d /home/html -sourcepath .

to get all the packages defined under the currect directory

But it doesn't seem to work that way. But what would be the way to get that?

CodePudding user response:

GUI based answer, unrelated

An easy and cozy way (requires IntelliJ window image

  • Open the Tools menu.
    Image showing Menu

  • Click on Generate JavaDoc....
    Image showing highlighted option

  • In JavaDoc Scope, choose the Whole project radiobutton. Image with JavaDoc options

  • CodePudding user response:

    What stops you from running javadoc directly? As you can see from the documentation, specifying package names is optional. So far I never specified packages and always obtained the full project.

    CodePudding user response:

    If your project is in C:\JavaProject and the source files are in C:\JavaProject\src,

    Use command:

    cd C:\JavaProject\src
    

    followed by:

    javadoc -d C:\JavaProject\docs * -subpackages *
    

    Warning: This method will fail if it encounters a subdirectory that is not a package or source.

    • Related