How to generate Javadoc from command line

前端 未结 8 977
太阳男子
太阳男子 2020-12-04 16:33

Can anybody show me how to generate Javadoc from command line?

My project contains the package com.test and I want to put the generated documentation in

8条回答
  •  日久生厌
    2020-12-04 16:56

    The answers given were not totally complete if multiple sourcepath and subpackages have to be processed.

    The following command line will process all the packages under com and LOR (lord of the rings) located into /home/rudy/IdeaProjects/demo/src/main/java and /home/rudy/IdeaProjects/demo/src/test/java/

    Please note:

    • it is Linux and the paths and packages are separated by ':'.
    • that I made usage of private and wanted all the classes and members to be documented.

    rudy@rudy-ThinkPad-T590:~$ javadoc -d /home/rudy/IdeaProjects/demo_doc
    -sourcepath /home/rudy/IdeaProjects/demo/src/main/java/
    :/home/rudy/IdeaProjects/demo/src/test/java/
    -subpackages com:LOR 
    -private
    
    rudy@rudy-ThinkPad-T590:~/IdeaProjects/demo/src/main/java$ ls -R 
    .: com LOR
    ./com: example
    ./com/example: demo
    ./com/example/demo: DemowApplication.java
    ./LOR: Race.java TolkienCharacter.java
    
    rudy@rudy-ThinkPad-T590:~/IdeaProjects/demo/src/test/java$ ls -R 
    .: com
    ./com: example
    ./com/example: demo
    ./com/example/demo: AssertJTest.java DemowApplicationTests.java
    

提交回复
热议问题