views:

444

answers:

1

I am using Eclipse 3.4.1.

While this may sound strange, I want to be able to attach more than one JavaDoc location to the same JAR in an Eclipse project. This particular JAR has classes from two sets of JavaDoc. The reason for this is that it is an OSGi bundle, which consists of a third-party JAR, and some other third-party code on top of that JAR to make it work in OSGi.

If I have the source code to both packages, and have that source code in an Eclipse project, it works fine. But I'd like to be able to get this to work in the case that I just have the JARs and JavaDoc.

+1  A: 

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

VonC