Version 4

    Generating a project site with Maven


    Maven can be used to generate a web site for your project.  This is done using the maven site plugin.  An Introduction to maven site generation can be found at


    There are two steps to the process: (1) generate the site, (2) deploy the site.


    A basic site can be generated with the following command:


    mvn site:site


    The site will be created in the target/site diretory.  It is a good idea to view the generated site to verify that it looks ok before deploying.  The site plugin uses the plugins listed in the reporting section of the pom to determine some of the automatically generated information.


    For example, to include javadocs in the maven site, the javadoc plugin can be included in the pom similar to the following:



    The second step is to deploy the generated site to a server where it is accessible from the Internet.


    This is done using the deploy goal of the maven site plugin.

    mvn site:deploy


    This goal simply copies the generated site to the location specified in the "site" section of the distributionManagement section of the pom.  For example the jboss-retro project has the following site configuration:

          <!-- This should be set to a local checkout of the freezone. -->

    The variable "" can be configured in the settings.xml or on the command line.




    Integration with


    Each project has its content contained in subversion under this location:

    The first step is to check out your project site, or if there is no site for your project, you can make a request for a new one from the team.  After your basic project site has been created, check it out from svn.


    The maven integration uses a feature of called "freezone" which is basically a way to host content as is.  Meaning without any additional markup.  There will be a subdirectory of the project checkout called "freezone", and this is where you can deploy your maven generated site.  Since by default maven creates a site with an apache configured look and feel, it is recommended to use a specialized skin for the site.


    The skin can be configured in the file called "site.xml" which should be located in the directory src/site.


    <project name="JBoss Retro">


    This skin will remove all the apache content (heading, menus, etc) of the generated site, and keep only the main body of the reports.  More information about configuring the site descriptor can be found here


    After configuring the skin, you can generate the site using

    mvn site:site

    .  When you view the html files, they will contain very little formatting information.  Next, check that the url in the site configuration points to the location of the local checkout of the freezone directory.

          <!-- This should be set to a local checkout of the project freezone. -->


    Now you can run

    mvn site:deploy

    and the generated site will be copied to the freezone directory.  Next, commit the files to svn, and the new content will appear on the site within about 10 minutes.


    For information about how to add content to the site, like project description, usage, etc. please refer to the

    maven book



    Note: work is currently in progress to improved the integration between the maven generated site and so that the skin configuration will not be necessary.



    Some examples of maven generated sites on







    Referenced by: