Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create javadoc with multiple src dirs

Tags:

java

javadoc

I have a Util package with source files in three seperate directories, defined like so:

  • src/com/domain/util
  • src/Standard/com/domain/util
  • src/Extended/com/domain/util

The package is built with the first set of files and either one of the second or third set, to create a total of two different implementations of the same interface.

Now, I want to generate javadoc based on those files. How can I specify that? What I really want to do is

javadoc com.domain.util -sourcepath ./src;./src/Standard

to build the javadoc for the standard util package, and

javadoc com.domain.util -sourcepath ./src;./src/Extended

to build the javadoc for the extended util package. This doesn't work. The only way I've found so far to actually make it work is to merge the directory structure of the common classes and the Standard classes into another location and run with that for the standard javadoc, then do the same for the Extended package. Is there another way?

like image 724
Ed Marty Avatar asked Feb 22 '10 21:02

Ed Marty


People also ask

How do I create an automatic javadoc?

In the Package Explorer view, select a Java project and click Project > Generate Javadoc with Diagrams > Automatically. In the Generate Javadoc wizard, under Javadoc command, select the Javadoc command (an executable file). Note: Only Oracle JDK Version 1.4.

Do private methods need javadoc?

Nope, you shouldn't write javadoc for private methods. End users don't have access to private fields or methods so there really isn't a point in providing javadoc for them. Private fields and methods are only meant for the developer. If you really need to though, feel free to write comments for non-obvious logic.


1 Answers

I ended up writing a script to copy the two directories into a third temp directory and run the javadoc on that.

like image 153
Ed Marty Avatar answered Oct 22 '22 11:10

Ed Marty