17 September 2011

You can add Google Analytics to a site generated with the Maven Site Plugin as by adding a <googleAnalyticsAccountId/> element containing your Web Property ID.

site.xml
<?xml version="1.0" encoding="ISO-8859-1" ?>
<project
    xmlns="http://maven.apache.org/DECORATION/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
        http://maven.apache.org/DECORATION/1.1.0
        http://maven.apache.org/xsd/decoration-1.1.0.xsd"
    name="...">

    <googleAnalyticsAccountId>...</googleAnalyticsAccountId>
    .
    .
    .
</project>

Brian Matthews