Any way to insert javadoc into a jar

Is there a way to insert javadoc (the / doc folder created by the JavaDoc Ant Task) into the jar library that contains my .class files?

I would prefer not to send the source code and would like users to be able to see javadoc comments in eclipse without having to go to the "Linked Libraries" tab and add a JavaDoc mailbox to my third-party library.

+6
source share
2 answers

Of course you can put javadoc in your binary JAR ... but does it really make sense?

To read javadocs, the user will have to unzip the HTML files from the JAR file into the Android file system, and then specify the Android browser in the index.html file (or something else). But the best model to use a JAR file to run your code is to NOT unzip it. And if you do not expect your users to try to view javadoc on their phones (!?!) ... then put javadocs in the dead weight JAR file.

It makes sense to distribute the javadoc tree in a separate zip or tar file.

Finally, if you expect users to develop code for the API in your product, it will be much easier for them if you provide them with the source code. You will get better customer satisfaction, fewer support requests to help them debug their code, and fewer unreasonable complaints that your code does not work.

+3
source

Of course, you can update the jar file this way.

jar uf <your_jar> doc/<your doc file>

+1
source

Source: https://habr.com/ru/post/887322/


All Articles