Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish versioned JavaDoc/Site to github pages in Java project?

If a project is named foo, I want to publish Javadocs for different versions separate directories, like:

me.github.io/foo/1.0/apidocs/
me.github.io/foo/2.0/apidocs/

The similar problem is discussed here: https://github.com/github/maven-plugins/issues/22 but it doesn't seem that the problem is solved

like image 984
leventov Avatar asked Dec 15 '22 11:12

leventov


1 Answers

I use javadoc.io for hosting javadoc for my open source projects on Github, and then link to that from the readme.md and github pages (e.g. here is the javdoc for the latest version of one of my projects : http://www.javadoc.io/doc/com.aol.simplereact/simple-react/0.99.2).

It's simple enough to set up. Once you've released to Maven Central or bintray (including your sources) browse to

http://www.javadoc.io/doc/<group id>/<artefact id>/<version>

That will get your library added to the system and it should download the javadoc and add it to the site within a day (sometimes immediately).

It's better than managing the process yourself, and it is guaranteed to match the actual version of the code that people are using (and the source they'll see in their IDEs), as it is downloaded from the same version repo in Maven Central. (If you manage your own, the possibility of uploading subtely different versions to Maven Central and your hosting site emerges).

like image 149
John McClean Avatar answered Dec 21 '22 11:12

John McClean