Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven site in gradle

Is there a plugin in gradle which can generate maven site similar thing? It would be great if it was compatible with current maven site apt format file.

like image 741
Tim Avatar asked May 21 '15 20:05

Tim


2 Answers

It seems that there are two plugins, this and this. The first one was committed four years ago, I know nothing about the second. So it seems that these plugins will not be helpful.

like image 183
Opal Avatar answered Oct 18 '22 14:10

Opal


I just wrote one as part of Gradle Fury. The primary plugin(s) (it's really just a collection of scripts) for Gradle-Fury is to enhance/fix many of the gradle short comings on publishing, android stuff, pom stuff, etc. Since there's pretty much no standard way for most things in gradle, we jam most of those configurations in the gradle.properties file. That said, the site plugin does depend on those settings to correctly stylize the site.

In short, to apply to your project... put this in your root build.gradle file apply from 'https://raw.githubusercontent.com/gradle-fury/gradle-fury/master/gradle/site.gradle'

Next edit your gradle.properties file and use this link as a template for your pom settings.... https://github.com/gradle-fury/gradle-fury/blob/master/gradle.properties

Create a src/site/ directory.

Make a src/site/index.md file as your home page

Copy/clone following files/folders from https://github.com/gradle-fury/gradle-fury/tree/master/src/site

  • css
  • images
  • img
  • js
  • template.html

Finally, build the site with gradlew site. Default output is to rootDir/build/site

Don't like the way it looks? (it looks like the Apache Fluido theme from the maven site plugin). Just edit template.html to meet your needs.

I'm currently working on a mechanism to bootstrap the site plugin which will remove a few of these steps, but that's what it is right now. More info and complete feature list is at the wiki

One last note, should run gradlew site after all of your check tasks, but it's not wired up to depend on it. Basically, anything that produces reports for your modules should be ran before site since it's aggregated into the site package, including javadocs and much more. The rest of the fury scripts help automate much of the painful configuration steps. Worth checking out (see the quality and maven-support plugins)

Disclaimer: I'm one of the authors.

Edit: site preview: http://gradle-fury.github.io/gradle-fury/

Edit: We just cut an updated version that makes manual creation of src/site and all the copy/clone tasks from the master repo unnecessary. Just run gradlew site while internet connected and it'll do the rest for you.

like image 40
spy Avatar answered Oct 18 '22 16:10

spy