Maven Fluido Skin and Javadoc class diagrams

I have been using Maven sites for a while, and am very happy with it. I didn’t like to have to update my projects after Maven 3, but that was all right, Maven 3 brought many new cool things. However, there were two things that annoyed me: lack of a nice and modern skin, and browsing Javadoc of complex code. The thought of creating a custom Maven skin even crossed my mind, but I never had time to read about it.

But the world is full of good and talented people! Like the guys from 99soft. They created Maven Fluido Skin, and donated it to Apache Software Foundation. It’s built on top of Twitter’s Bootstrap and available from Maven central repository. In order to use it in your Maven project, all that you have to do is add the following settings into your src/site/site.xml:

<skin>
    <groupId>org.apache.maven.skins</groupId>
    <artifactId>maven-fluido-skin</artifactId>
    <version>1.2.1</version>
</skin>

Here’s a list of some projects using Maven Fluido Skin (hopefully, in the near future Apache Commons and other projects will adopt this skin as default too ):

Regarding the Javadoc browsing, there’s a nice trick too: add class diagrams. I have seen a new Javadoc template in Apache Commons mailing list, but it was a work in progress, so for now I will stick with class diagrams. These diagrams are generated when you execute the javadoc or the site goals, using graphviz. And there is more. You can click on the diagram classes, as they have a link to the Java class that they reference to.

You can find instructions for setting up the diagram generation in Apache Maven web site, or looking at examples (I prefer the latter). But basically, you will need graphviz installed, and something like the following XML snippet in your project pom.xml.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <version>2.7</version>
    <configuration>
        <doclet>gr.spinellis.umlgraph.doclet.UmlGraphDoc</doclet>
        <docletArtifact>
            <groupId>gr.spinellis</groupId>
            <artifactId>UmlGraph</artifactId>
            <version>4.4</version>
        </docletArtifact>
        <additionalparam>
            -inferrel -inferdep -quiet -hide java.*
            -collpackages java.util.* -qualify
            -postfixpackage -nodefontsize 9
            -nodefontpackagesize 7
            -edgefontname 'Trebuchet MS'
            -nodefontabstractname 'Trebuchet MS'
            -nodefontclassabstractname
            'Trebuchet MS'
            -nodefontclassname 'Trebuchet MS'
            -nodefontname
            'Trebuchet MS'
            -nodefontpackagename 'Trebuchet MS'
            -nodefonttagname
            'Trebuchet MS'
        </additionalparam>
    </configuration>
</plugin>

Here’s how a diagram looks like (source: http://tap4j.org/apidocs/index.html):

Have fun! And remember to check if your CI machine has graphviz installed too, otherwise you will have 404 in your Javadoc pages.

Happy coding and don’t forget to share!

Reference: Maven site tips: Maven Fluido Skin and Javadoc class diagrams from our JCG partner Bruno Kinoshita at the Kinoshita’s blog blog.

Related Whitepaper:

Functional Programming in Java: Harnessing the Power of Java 8 Lambda Expressions

Get ready to program in a whole new way!

Functional Programming in Java will help you quickly get on top of the new, essential Java 8 language features and the functional style that will change and improve your code. This short, targeted book will help you make the paradigm shift from the old imperative way to a less error-prone, more elegant, and concise coding style that’s also a breeze to parallelize. You’ll explore the syntax and semantics of lambda expressions, method and constructor references, and functional interfaces. You’ll design and write applications better using the new standards in Java 8 and the JDK.

Get it Now!  

Leave a Reply


8 + = fifteen



Java Code Geeks and all content copyright © 2010-2014, Exelixis Media Ltd | Terms of Use | Privacy Policy
All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners.
Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries.
Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.

Sign up for our Newsletter

20,709 insiders are already enjoying weekly updates and complimentary whitepapers! Join them now to gain exclusive access to the latest news in the Java world, as well as insights about Android, Scala, Groovy and other related technologies.

As an extra bonus, by joining you will get our brand new e-books, published by Java Code Geeks and their JCG partners for your reading pleasure! Enter your info and stay on top of things,

  • Fresh trends
  • Cases and examples
  • Research and insights
  • Two complimentary e-books