Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should one distribute the Javadoc for a Library?

Tags:

I am writing a custom library. It's build into a .jar archive. I am fully able to generate the javadoc, but I don't know how I should distribute it?

  1. Put it in the same .jar with the library
  2. Put it in a different .jar
  3. Some other way?

And how to include the javadoc in another project that uses my lib?

  1. If I had put it in the same .jar, should I have written something in the manifest?
  2. If it's in a separate .jar, is including it in the project enough?

I am using NetBeans 9.1.

like image 757
Albus Dumbledore Avatar asked Oct 07 '10 10:10

Albus Dumbledore


People also ask

How do I publish a Javadoc?

In the Goals field, place javadoc:javadoc —this will tell Maven to generate the Javadoc documentation. Now go to the “Post-build Action” and tick the “Publish Javadoc” checkbox. This project is a multimodule project, so a separate subdirectory is generated for each module (core, services, web and so forth).

Where do I put Javadoc files?

As specified in the Javadoc tool documentation, in the "Miscellaneous Unprocessed Files" section: To include unprocessed files, put them in a directory called doc-files which can be a subdirectory of any package directory that contains source files. You can have one such subdirectory for each package.

Which command should you use to package Javadoc into a jar file?

The “maven-javadoc” plugin uses “ JDK\bin\javadoc.exe ” command to generate javadocs, pack in jar file and deploy along with your project.


1 Answers

I'd include the library .jar and the documentation and other things, like a README, License file etc. in a single archive (zip or tar.gz)

mylib-1.0.1.tar.gz , which contains:

mylib-1.0.1/
           ├── javadoc
           │   └── index.html  (and all other javadoc files under here)
           ├── mylib-1.0.1.jar
           └── README

Instead of the expanded javadoc/ sub directory within the archive, you could add the compressed javadoc in a mylib-1.0.1-javadoc.jar (or zip) , both options are common.

mylib-1.0.1/
           ├── mylib-1.0.1-javadoc.jar
           ├── mylib-1.0.1.jar
           └── README
like image 65
nos Avatar answered Sep 29 '22 16:09

nos