63

Right now I am using the maven-javadoc-plugin to attach the Javadoc to .jar artifacts when I am doing a release.

However, how can I generate the Javadoc in an html format so we can scp it to a remote server for reference?

Thanks!

Sam Levin
  • 3,326
  • 7
  • 30
  • 44

2 Answers2

90

Using the same plugin, you can generate javadoc in a folder using

mvn javadoc:javadoc

It puts the help content under target/site/apidocs

You can change the output folder by using the plugin configuration parameter reportOutputDirectory

Please refer to:

Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
krishnakumarp
  • 8,967
  • 3
  • 49
  • 55
  • 1
    What if I want to generate the javadocs when i execute `clean install` command. I am currently trying that, but the java docs are not getting generated on Clean install. I am using `javadoc:javadoc package` – AnirbanDebnath Apr 19 '16 at 10:35
15

if you are interested in just doing it raw, you could use the following command.

javadoc -d C:/javadoc/test com.mypackage
SysDragon
  • 9,692
  • 15
  • 60
  • 89
Vinod Bhan
  • 159
  • 1
  • 3
  • 1
    you are right, somethings are so easy and maven make us believe that everything is so complex tha twe need maven in situations that are quite trivial! – MadMad666 Jun 26 '15 at 20:51
  • 5
    y'all need to use ant for a a half-complex build process, then tell me maven's vile. maven is a life-saver and i, for one, welcome my xml-based overlords – liltitus27 Jul 28 '16 at 13:58