14

I have a Java application consisting of several modules. I'd like to generate Javadoc for all of them together: that is to say, from these several modules, I'd like a single collection of HTML files with a single index.html, a single allclasses-frame.html etc. and the various hyperlinks should work across modules.

I use Maven but I'm not necessarily constrained to Maven-specific solutions. This will be performed by a cron job so other tools could also be used.

What is the most straightforward way to auto-generate Javadoc in this case?

2
  • Is this still open? If yes, please comment on the answers saying how they don't help. If no, please accept the best answer (or add an answer of your own, if no answer is good enough, and you found out how it works). Jun 29, 2011 at 12:38
  • A solution for Gradle which combines input sources is available here: stackoverflow.com/a/67854781/39334
    – stolsvik
    Nov 29, 2022 at 20:13

1 Answer 1

4

If you can manage it, javadoc can generate the combined documentation provided that you combine the input sources. Perhaps there is a more elegant solution; but, why not copy all the sources into a combined tree and then run javadoc?

The other option is to use the -link option and have one site's documentation refer to another site's documentation. Note that if you choose this option, you may want to also look at the linkoffline option for flexibility in your javadoc builds (unless you manage to deploy documentation to the web servers in the correct order before it is needed by subsequent builds).

2
  • 1
    +1 - simply set the sourcepath (and the packages) to include everything you want to document. Jun 28, 2011 at 16:21
  • 2
    Because I have lots of modules and it would be quite the complicated copy operation.
    – Martin
    Dec 29, 2021 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.