0

I've two jars, one for interfaces and one for implementations. For example in the first jar i have:

package com.myapp.jar1
public inteface MyInterface {...}

in the second jar I have

package com.myapp.jar2
import com.myapp.jar1.MyInterface

public class MyClass implements MyInterface {...}

When javadocs are created via maven, the reference to the class in the same package are converted in links (as expected) while the reference to the class in the other package is simple text.

I suppose the problem is that javadoc doesn't know where and who is MyInterface.

Does exists a way to inform javadoc to check in other packages for doc?

Details:

In Apache I have a dir javadoc and i unzip there all my jars:

/var/www/html/javadoc/jar1
/var/www/html/javadoc/jar2

So my link would point to another position in the same server or to an external resource if is a third-produced package (for example Jackson)

Daniele Licitra
  • 1,520
  • 21
  • 45

1 Answers1

0

Use javadoc this way to find other packages:

{@link [<package>.]<class>[#<method>] label}
{@link [<package>.]<class>[#<method>]}
{@link #<method>}

Example:

{@link com.project.Interfaces.MyInterface MyInterface}

If you want to show complete path don't use label.


Javadoc in another .jar:

  1. Right click over the project:
  2. Build path > Configure build path
  3. Libraries > Select the library and expand it
  4. Select "Javadoc location" > click the "Edit" button on the right.
  5. Add your jar file with the docs
  6. Click in "Validate" button to check if has any problem

This jar it's a renamed extension of a zip file and need to have an index.html in the root directory.


References:

ℛɑƒæĿᴿᴹᴿ
  • 4,983
  • 4
  • 38
  • 58
  • I was a bit unclear. The classes are in different JAR files, not only different packages. When javadoc create the doc for MyClass he wrote something like `public class MyClass implements MyInterface` instead of something more useful `public class MyClass implements MyInterface` – Daniele Licitra Jun 08 '18 at 16:21
  • @DanieleLicitra I edited the answer, look if this helps you. – ℛɑƒæĿᴿᴹᴿ Jun 08 '18 at 17:33