Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making JavaDocs available with GitHub, Sonatype Maven repo [closed]

Tags:

Although Github provides a nice home for Java open source projects, there are some things that are still missing compared to more mature open source hosting places. I have so far figured out that Sonatype offers Maven repository access for open source projects, which solves one issue; and there are many solutions for user/dev mailing lists.

But one thing I am now trying to resolve is that of publishing automatically generated javadocs for online browsing. Although publishing source jars via Maven helps a bit with IDEs, I still like ability to browse javadocs online without downloading or importing a project. Does anyone know of a good way to achieve this, for projects hosted at Github? (need not be something Github offers, but ideally something that can be automated to happen when release is cut)

like image 391
StaxMan Avatar asked Oct 15 '10 04:10

StaxMan


3 Answers

GitHub serves static HTML files that are in the gh-pages branch of your repo at http://your_username.github.com/your_repo/. In theory, Maven could be made to do the following:

  1. Commit the release pom.xml.
  2. Generate the JavaDocs to a .gitignore'd directory (so it would be preserved across branch changes).
  3. Checkout the gh-pages branch.
  4. Replace all of the files in the working directory with that of the directory the JavaDocs were copied to
  5. Commit
  6. Checkout the original branch.
  7. Continue with release...

I'm only two days in to using Maven for a few of my projects so this is way beyond my capabilities. I'd be eager to see this implemented either with existing plugins or a custom plugin.

like image 70
Jake Wharton Avatar answered Sep 23 '22 10:09

Jake Wharton


There is now a Maven plugin that can push a directory to a particular branch on githib at: http://github.com/github/maven-plugins.

like image 26
Gewthen Avatar answered Sep 25 '22 10:09

Gewthen


You can use a shell script to do the git checkout/add/commit/checkout/push as Jake Wharton suggested, and configure Ant or Gradle to run the shell script after it generates the javadoc. I'm not sure this would work with Maven. Here's an example shell script.

like image 25
John Kristian Avatar answered Sep 22 '22 10:09

John Kristian