Not trivial to do, since the information about the javadocs is stored in the classpathentry
of the .classpath
file of your project, and it is composed of one value (a directory or an archive)
The solution would be to build a single javadoc which include both current javadocs, and attached that archive to the jar.
Another solution (which might not be correctly interpreted by eclipse: to be tested) is links to the external docs
Example using relative links to the external docs:
Let's say you have two packages whose docs are generated in different runs of the Javadoc tool, and those docs are separated by a relative path.
In this example, the packages are com.apipackage
, an API, and com.spipackage
, an SPI (Service Provide Interface).
You want the documentation to reside in docs/api/com/apipackage
and docs/spi/com/spipackage
.
Assuming the API package documentation is already generated, and that docs is the current directory, you would document the SPI package with links to the API documentation by running:
C:> javadoc -d ./spi -link ../api com.spipackage
Notice the -link argument is relative to the destination directory (docs/spi).
So may be if you attach only the second javadoc to the jar, it may pick up classes documented in the first javadoc... but I doubt it.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#linkrelativeexample