Thursday, April 1, 2010

Include Java source code in generated JavaDoc

I wanted to include Java source code directly in generated javaDoc. However, I found that I forgot it. And it is not very quick found after I google it though it should be very simple. Maybe, it is too simple and people is not bothered to document it. So, I am writing a note here in case I will forget it again.

It is really very simple. All I need to do is just put "-linksource" option when I use javadoc tool. In netbeans, it is very easy to generate javadoc by right clicking the project and selecting "Generate Javadoc" menu item. In order to include java source code, we need to add options to project properties as below,
  1. right click your project and select properties.
  2. selecting Documenting under Build node in the pop up window.
  3. adding -linksource in the "Additional Javadoc Options" text field.
See below pic for a clear view.

No comments:

Post a Comment