Reputation: 6968
I am trying to generate java documentation for multiple packages so I have a single index.html, I can generate them fine for single packages by writing,
javadoc packages/mypackage1/program/*.java
but I can't get it to work for multiple packages. I tried using javadoc @packages but I get
error - cannot read packages <access is denied>
Any ideas would be great!!
Upvotes: 5
Views: 4846
Reputation: 5477
Let's give an example:
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:
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
Upvotes: 1
Reputation: 304
javadoc -d [DESTINATION_FOLDER] -sourcepath [SOURCE_FOLDER] -subpackages [PACKAGE1]:[PACKAGE2]
For example, if your hierarchy is:
Then your command line will look like:
javadoc -d [DESTINATION_FOLDER] -sourcepath /home/my_project/src -subpackages com:fr
Upvotes: 7