One awesome plugin, in the great variety of plugins that come with maven, is the site plugin. Its goal is to automatically generate a website based on content provided by the user. This website is enriched with automatically generated documentation.

An elementary part of the site plugin is the site.xml file. This file has to be stored in project/src/site. It includes all additional contents to be added to the project site and describes the layout of the site. Maven organizes the actual contents by format. The user has to ensure that custom files are stored in a special format. Maven supports XML and APT among others. When it generates the site, the contents are converted to HTML.

you will find detailed information on how to configure the site descriptor.

The MD-format

MD stands for “markdown”. It strives for simplicity and therefore is a format that users will learn intuitively. For more information, visit

Luckily, the site plugin now parses Markdown files as well.

Auto generated content by plugins

One section of the pom.xml is devoted to the plugins embedded into the project. The following table gives an overview about various plugins generating sections on the website.

ArtifactID Type Description Link
maven-license-plugin build plugin Updates license headers of source files
maven-project-info-reports-plugin reporting plugin Responsible for displaying information about continuous integration, dependencies, etc.
maven-dependency-plugin build plugin Provides the capability to manipulate artifacts
maven-javadoc-plugin reporting plugin Uses the Javadoc tool to generate javadocs for the specified project
maven-jxr-plugin build plugin Produces cross-references of the project’s sources
maven-surefire-report-plugin reporting plugin Parses the generated TEST-*.xml files under ${basedir}/target/surefire-reports and renders them to DOXIA creating the web interface version of the test results
cobertura-maven-plugin build plugin Shows output of Cobertura
maven-checkstyle-plugin reporting plugin Generates a report regarding checkstyle
maven-pmd-plugin reporting plugin Generating a site report with PMD results
maven-compiler-plugin build plugin Used to compile the sources of your project
maven-assembly-plugin build plugin Primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive.
maven-source-plugin build plugin Creates a jar archive of the source files
maven-site-plugin reporting plugin Responsible for generating and deploying the project site
maven-acr-plugin build plugin This plugin generates J2EE Application Client files
maven-antrun-plugin build plugin Provides the ability to run Ant tasks within Maven 2
maven-changelog-plugin reporting plugin Generates reports regarding recent changes in your SCM
maven-clean-plugin build plugin Used when you want to remove files generated at build-time in a project’s directory
maven-deploy-plugin build plugin Primarily used during the deploy phase, to add your artifact(s) to a remote repository for sharing with other developers and projects
maven-eclipse-plugin build plugin Used to generate Eclipse IDE files (*.classpath, *.wtpmodules and the .settings folder) for use with a project
maven-enforcer-plugin reporting plugin Provides goals to control certain environmental constraints such as Maven version, JDK version and OS family along with many more standard rules and user created rules
maven-failsafe-plugin build plugin Designed to run integration tests while the Surefire Plugins is designed to run unit tests
maven-help-plugin reporting plugin Used to get relative information about a project or the system or particular plugins
maven-install-plugin build plugin Used during the install phase to add artifact(s) to the local repository
maven-invoker-plugin reporting plugin Runs a set of Maven projects
maven-jar-plugin build plugin Provides the capability to build and sign jars
maven-patch-plugin build plugin Used to apply patches to source files
maven-pdf-plugin reporting plugin Allows you to generate a PDF version of your project’s documentation
maven-plugin-plugin build plugin Creates a Maven plugin descriptor for any mojos found in the source tree to be included in the JAR
maven-release-plugin build plugin Releases a project with Maven, saving a lot of repetitive, manual work
maven-repository-plugin build plugin Creates bundles of artifacts that can be uploaded to the central repository
maven-resources-plugin build plugin Handles the copying of project resources to the output directory
maven-stage-plugin build plugin Copies artifacts from one repository to another
maven-surefire-plugin build plugin Used during the test phase of the build lifecycle to execute the unit tests of an application
maven-toolchain-plugin build plugin Shares configuration across plugins. Makes for example sure the plugins like compiler, surefire, javadoc, webstart etc. all use the same JDK for execution
maven-war-plugin build plugin Responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive
doxia-module-markdown build plugin Supports markdown formate for site generation

Configuring the site-deploy

Having generated your project site with the help of site plugin, you’ll probably want to deploy it somewhere. This can be accomplished either locally (in $project_basedir/target/site) or on a remote server. In the latter case, you’ll have to decide which protocol you want to use to upload the site. Usually, this would be FTP or FTPs. Due to a buggy wagons, it currently is SSH.

  • Assuming you want to store your project site on a remote server, you’ll need to add the project site to the distribution management of your pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">

1st note: In case you should want to deploy your site with FTP over SSL, the url has to be ftp://... instead of ftps://...
2nd note: Until further notice, the distributionManagement section contains the following info:

      <!-- <url>s</url> -->
      <!-- <id>perfidix-rz</id> <url>s</url> -->
  • Next, you’ll need to edit the extensions section of the pom to implement the wagon uploading the site.
      <artifactId> wagon-ssh</artifactId>
  • Now that the adjustments of the pom.xml are complete, you’ll need to add your credentials for your project site to $user's_homedir/.m2/settings.xml.
<settings xmlns="" xmlns:xsi="" xsi:schemaLocation="">
      <id> </id>
      <username> </username>
      <password> </password>
  • You are now able to deploy your project site with
mvn site:deploy 

Site Generation for Multi Module Projects

Generating a multi module project site locally will work at first sight. Taking a closer look, you will discover that the relative links don’t work properly. This is fixed with a successful site:deploy.

If you want to make sure that the site works properly before deploying it, site:stage is the solution. For this, you need to add the distributionManagement section as well as project-wide required plugins and dependencies only to the parent pom. After that, site:stage will provide a local version of the project site in a subdirectory of $project_basedir/src/staging which is named either after the server it’s going to be deployed to or as “complete”.

Generation of Project Reports

Treetank’s root site contains all project-wide information such as license, project team, etc. Selective reports can be generated by adding the desired reports to the project-info-reports-plugin of the root POM.


Inherited or module specific plugins such as maven-pmd-plugin must be added to the plugin section of the corresponding POMs. To display the project reports, the menus in the site.xml files must be set to reports:

<menu ref="reports"/>