Search code examples
javamavengradleintellij-ideajavadoc

If we publish the sources.jar that contains Javadocs in the code, isn't publishing the javadoc.jar repetitive?


I often see tutorials instruct us to generate both sources.jar and javadoc.jar. Some IDEs also download both jars by default. Is there any reason behind it? Why don't IDEs just download the sources.jar if it's exist since they could read the Javadocs from it?


Solution

  • Published javadoc contains a set of connected HTML files ready to be viewed in a browser. The processing is not trivial.

    Your analogy is similar to “why publish binaries if people can just download the sources which contain the same”. (Maven is just a fancy cache for javac) and the answer is the same: to make it easier to use.