<?xml version="1.0" encoding="UTF-8"?>

<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

 Copyright © 2011-2014 ForgeRock AS. All rights reserved.

 The contents of this file are subject to the terms
 of the Common Development and Distribution License
 (the License). You may not use this file except in
 compliance with the License.

 You can obtain a copy of the License at
 http://forgerock.org/license/CDDLv1.0.html
 See the License for the specific language governing
 permission and limitations under the License.

 When distributing Covered Code, include this CDDL
 Header Notice in each file and include the License file
 at http://forgerock.org/license/CDDLv1.0.html
 If applicable, add the following below the CDDL Header,
 with the fields enclosed by brackets [] replaced by
 your own identifying information:
 "Portions Copyrighted [year] [name of copyright owner]"
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.forgerock</groupId>
    <artifactId>forgerock-parent</artifactId>
    <version>1.2.1</version>
    <packaging>pom</packaging>
    <name>ForgeRock Parent</name>
    <description>Parent POM for ForgeRock projects. Provides default project build configuration.</description>
    <url>http://www.forgerock.com</url>
    <licenses>
        <license>
            <name>CDDL-1.0</name>
            <url>http://opensource.org/licenses/CDDL-1.0</url>
            <comments>Common Development and Distribution License (CDDL) 1.0</comments>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <organization>
        <name>ForgeRock AS</name>
        <url>http://www.forgerock.com</url>
    </organization>
    <issueManagement>
        <system>jira</system>
        <url>https://bugster.forgerock.org</url>
    </issueManagement>
    <scm>
        <connection>scm:svn:https://svn.forgerock.org/commons/forgerock-parent/tags/1.2.1</connection>
        <developerConnection>scm:svn:https://svn.forgerock.org/commons/forgerock-parent/tags/1.2.1</developerConnection>
        <url>http://sources.forgerock.org/browse/commons/forgerock-parent/tags/1.2.1</url>
    </scm>
    <distributionManagement>
        <snapshotRepository>
            <id>forgerock-snapshots</id>
            <name>ForgeRock Snapshot Repository</name>
            <url>${forgerockDistMgmtSnapshotsUrl}</url>
        </snapshotRepository>
        <repository>
            <id>forgerock-staging</id>
            <name>ForgeRock Release Repository</name>
            <url>${forgerockDistMgmtReleasesUrl}</url>
        </repository>
        <site>
            <id>forgerock.org</id>
            <name>ForgeRock Community</name>
            <url>scp://forgerock.org/var/www/vhosts/commons.forgerock.org/httpdocs/forgerock-parent</url>
        </site>
    </distributionManagement>

    <!-- (see FAQ at http://maven.apache.org/guides/mini/guide-central-repository-upload.html ) -->
    <repositories>
        <repository>
            <id>forgerock-staging-repository</id>
            <name>ForgeRock Release Repository</name>
            <url>http://maven.forgerock.org/repo/releases</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>forgerock-snapshots-repository</id>
            <name>ForgeRock Snapshot Repository</name>
            <url>http://maven.forgerock.org/repo/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>forgerock-plugins-repository</id>
            <name>ForgeRock Plugin Repository</name>
            <url>http://maven.forgerock.org/repo/repo</url>
        </pluginRepository>
    </pluginRepositories>

    <properties>
        <!-- ************** -->
        <!-- Build settings -->
        <!-- ************** -->

        <!-- Cross plugins settings -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- maven-compiler-plugin -->
        <maven.compiler.target>1.5</maven.compiler.target>
        <maven.compiler.source>1.5</maven.compiler.source>

        <!-- maven-enforcer-plugin -->
        <maven.min.version>3.0</maven.min.version>
        <jdk.min.version>${maven.compiler.source}</jdk.min.version>

        <!-- findbugs-maven-plugin -->
        <findbugsPluginVersion>2.5.2</findbugsPluginVersion>
        
        <!-- maven-javadoc-plugin -->
        <javadocPluginVersion>2.9</javadocPluginVersion>
        <!-- forgerock-build-tools stylesheet org/forgerock/javadoc/javadoc.css
             does not work with JDK7 -->
        <javadocStylesheet />
        <javadocWindowTitle>${project.name} ${project.version} Documentation</javadocWindowTitle>
        <javadocDocTitle>${javadocWindowTitle}</javadocDocTitle>

        <!-- maven-idea-plugin & maven-eclipse-plugin -->
        <downloadSources>true</downloadSources>
        <downloadJavadocs>true</downloadJavadocs>

        <!-- maven-pmd-plugin -->
        <pmdPluginVersion>2.7.1</pmdPluginVersion>
        <targetJdk>${maven.compiler.target}</targetJdk>

        <!-- maven-checkstyle-plugin -->
        <checkstylePluginVersion>2.9.1</checkstylePluginVersion>
        <checkstyleSourceConfigLocation>org/forgerock/checkstyle/check-src-default.xml</checkstyleSourceConfigLocation>
        <checkstyleDocTargetConfigLocation>org/forgerock/checkstyle/check-src-doc-target.xml</checkstyleDocTargetConfigLocation>
        <checkstyleUnitTestSuppressionsLocation>org/forgerock/checkstyle/unit-test-suppressions.xml</checkstyleUnitTestSuppressionsLocation>
        <checkstyleHeaderLocation>org/forgerock/checkstyle/default-java-header</checkstyleHeaderLocation>
        <checkstyleFailOnError>true</checkstyleFailOnError>

        <!-- clirr-maven-plugin -->
        <clirrPluginVersion>2.6.1</clirrPluginVersion>

        <!-- ***************** -->
        <!-- Repository Deployment URLs -->
        <!-- ***************** -->
        <forgerockDistMgmtSnapshotsUrl>http://maven.forgerock.org/repo/snapshots</forgerockDistMgmtSnapshotsUrl>
        <forgerockDistMgmtReleasesUrl>http://maven.forgerock.org/repo/releases</forgerockDistMgmtReleasesUrl>

        <!-- this property makes sure NetBeans 6.8+ picks up some formatting rules from checkstyle -->
        <netbeans.checkstyle.format>true</netbeans.checkstyle.format>
        
        <!--  ForgeRock build tools version -->
        <forgerockBuildToolsVersion>1.0.2</forgerockBuildToolsVersion>
    </properties>

    <prerequisites>
        <maven>${maven.min.version}</maven>
    </prerequisites>

    <build>
        <pluginManagement>
            <!--    mvn versions:display-plugin-updates
                    mvn versions:display-dependency-updates
                    mvn versions:use-latest-versions
            -->
            <plugins>
                <!-- set versions of common plugins for reproducibility, ordered alphabetically -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${findbugsPluginVersion}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.3.7</version>
                    <configuration>
                        <instructions>
                            <Implementation-Build>${ci.build.number}</Implementation-Build>
                            <SCM-Revision>${ci.svn.revision}</SCM-Revision>
                        </instructions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${checkstylePluginVersion}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.forgerock</groupId>
                            <artifactId>forgerock-build-tools</artifactId>
                            <version>${forgerockBuildToolsVersion}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.0</version>
                    <configuration>
                        <source>${maven.compiler.target}</source>
                        <target>${maven.compiler.target}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <compilerArgument>-Xlint:all</compilerArgument>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-docck-plugin</artifactId>
                    <version>1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <version>2.9</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-invoker-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jarsigner-plugin</artifactId>
                    <version>1.2</version>
                </plugin>
                <plugin>
                    <!--  See generate-javadoc profile - the configuration here
                          must be aligned with the report configuration
                          specified in the profile -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadocPluginVersion}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.forgerock</groupId>
                            <artifactId>forgerock-build-tools</artifactId>
                            <version>${forgerockBuildToolsVersion}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <author>false</author>
                        <quiet>true</quiet>
                        <windowtitle>${javadocWindowTitle}</windowtitle>
                        <doctitle>${javadocDocTitle}</doctitle>
                        <header><![CDATA[<b>${javadocDocTitle}</b>]]></header>
                        <footer><![CDATA[<b>${javadocDocTitle}</b>]]></footer>
                        <additionalparam>-linksource</additionalparam>
                        <show>protected</show>
                        <excludePackageNames>com.*</excludePackageNames>
                        <stylesheetfile>${javadocStylesheet}</stylesheetfile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>3.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${pmdPluginVersion}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.4.2</version>
                    <inherited>true</inherited>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <useReleaseProfile>true</useReleaseProfile>
                        <suppressCommitBeforeTag>false</suppressCommitBeforeTag>
                        <goals>deploy</goals>
                        <arguments>-Penforce,forgerock-release</arguments>
                       <tagNameFormat>@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <version>1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-plugin</artifactId>
                    <version>1.8.1</version>
                    <configuration>
                        <tag>${project.artifactId}-${project.version}</tag>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-ssh</artifactId>
                            <version>2.2</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.12.4</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.forgerock</groupId>
                            <artifactId>forgerock-build-tools</artifactId>
                            <version>${forgerockBuildToolsVersion}</version>
                        </dependency>
                    </dependencies>
                </plugin>
		<plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-failsafe-plugin</artifactId>
		    <version>2.12.4</version>
		</plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.plexus</groupId>
                    <artifactId>plexus-maven-plugin</artifactId>
                    <version>1.3.8</version>
                </plugin>
                <plugin>
                    <!--This plugin's configuration is used to store Eclipse m2e settings
                        only. It has no influence on the Maven build itself. It's really
                        annoying that we have to do this. The alternative is that each
                        developer who uses Eclipse must manually configure M2E. -->
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-dependency-plugin</artifactId>
                                        <versionRange>[2.6,)</versionRange>
                                        <goals>
                                            <goal>unpack</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.forgerock.commons</groupId>
                                        <artifactId>i18n-maven-plugin</artifactId>
                                        <versionRange>[1.2.0,)</versionRange>
                                        <goals>
                                            <goal>generate-messages</goal>
                                            <goal>generate-test-messages</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <execute>
                                            <runOnIncremental>true</runOnIncremental>
                                            <runOnConfiguration>true</runOnConfiguration>
                                        </execute>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-enforcer-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.codehaus.mojo</groupId>
                                        <artifactId>build-helper-maven-plugin</artifactId>
                                        <versionRange>[1.4,)</versionRange>
                                        <goals>
                                            <goal>reserve-network-port</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                  <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>xml-maven-plugin</artifactId>
                                    <versionRange>1.0</versionRange>
                                    <goals>
                                      <goal>transform</goal>
                                      <goal>validate</goal>
                                    </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                    <execute>
                                      <runOnIncremental>true</runOnIncremental>
                                      <runOnConfiguration>true</runOnConfiguration>
                                    </execute>
                                  </action>
                                </pluginExecution>
                                <pluginExecution>
                                  <pluginExecutionFilter>
                                    <groupId>org.codehaus.mojo</groupId>
                                    <artifactId>buildnumber-maven-plugin</artifactId>
                                    <versionRange>[0,)</versionRange>
                                    <goals>
                                      <goal>create</goal>
                                    </goals>
                                  </pluginExecutionFilter>
                                  <action>
                                    <execute>
                                      <runOnConfiguration>true</runOnConfiguration>
                                      <runOnIncremental>true</runOnIncremental>
                                    </execute>
                                  </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>enforce</id>
            <activation>
                <property>
                    <name>!skip-enforce</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-plugin-versions</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requirePluginVersions>
                                            <message>Best practice is to always define plugin versions!</message>
                                            <banLatest>true</banLatest>
                                            <banRelease>true</banRelease>
                                            <banSnapshots>false</banSnapshots>
                                            <phases>deploy,site</phases>
                                        </requirePluginVersions>
                                    </rules>
                                </configuration>
                            </execution>
                            <execution>
                                <id>enforce-java-version</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireJavaVersion>
                                            <message>To build this project JDK ${jdk.min.version} (or greater) is required. Please install it.</message>
                                            <version>${jdk.min.version}</version>
                                        </requireJavaVersion>
                                    </rules>
                                </configuration>
                            </execution>
                            <execution>
                                <id>enforce-maven-version</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireMavenVersion>
                                            <message>To build this project Maven ${maven.min.version} (or greater) is required. Please install it.</message>
                                            <version>${maven.min.version}</version>
                                        </requireMavenVersion>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>precommit</id>
            <build>
                <plugins>
                    <plugin>
                        <!-- Enforce Checkstyle during compilation -->
                
                        <!-- Strictly speaking Checkstyle should be invoked as a
                             report during site generation. However, we want
                             to fail the build if source code does not comply with
                             our coding guidelines, and not at a later stage when
                             the site is generated (which may never occur for some
                             projects).     
                        -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>check-src-and-tests</id>
                                <configuration>
                                    <configLocation>${checkstyleSourceConfigLocation}</configLocation>
                                    <headerLocation>${checkstyleHeaderLocation}</headerLocation>
                                    <suppressionsLocation>${checkstyleUnitTestSuppressionsLocation}</suppressionsLocation>
                                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                                    <!-- Only output errors if we're not expecting any -->
                                    <consoleOutput>${checkstyleFailOnError}</consoleOutput>
                                    <failsOnError>${checkstyleFailOnError}</failsOnError>
                                </configuration>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>checkstyle</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>metrics</id>
            <properties>
                <testReportsDirectory>${project.build.directory}/surefire-reports/cobertura</testReportsDirectory>
            </properties>
            <build>
                <plugins>
                    <!-- Enforce Checkstyle during compilation -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>

                    <!-- Cobertura -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <configuration>
                            <formats>
                                <format>xml</format>
                                <format>html</format>
                            </formats>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>cobertura</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

            <reporting>
                <plugins>
                    <!-- FindBugs -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>${findbugsPluginVersion}</version>
                        <configuration>
                            <xmlOutput>true</xmlOutput>
                            <findbugsXmlOutput>true</findbugsXmlOutput>
                            <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                            <effort>Max</effort>
                            <threshold>Low</threshold>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>

                    <!-- PMD -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <version>${pmdPluginVersion}</version>
                        <configuration>
                            <linkXref>true</linkXref>
                            <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                            <minimumTokens>100</minimumTokens>
                        </configuration>
                    </plugin>

                    <!-- CheckStyle -->
                    <plugin> 
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <version>${checkstylePluginVersion}</version>
                        <configuration>
                            <configLocation>${checkstyleSourceConfigLocation}</configLocation>
                            <headerLocation>${checkstyleHeaderLocation}</headerLocation>
                            <suppressionsLocation>${checkstyleUnitTestSuppressionsLocation}</suppressionsLocation>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <!-- Only output errors if we're not expecting any -->
                            <consoleOutput>${checkstyleFailOnError}</consoleOutput>
                            <!-- Reports should never fail site generation -->
                            <failsOnError>false</failsOnError>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>checkstyle</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <!-- We want to sign the artifact, the POM, and all attached artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <configuration>
                            <passphrase>${gpg.passphrase}</passphrase>
                            <useAgent>true</useAgent>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>                    
                </plugins>
            </build>
        </profile>
        <profile>
            <id>forgerock-release</id>
            <build>
                <plugins>
                    <plugin>
                        <inherited>true</inherited>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <!-- Publish also javasources when releasing - required -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Publish also javadocs when releasing - required -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-maven</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireMavenVersion>
                                            <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                                            <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
                                        </requireMavenVersion>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>maven-3</id>
            <activation>
                <file>
                    <!--  This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
                    <exists>${basedir}</exists>
                </file>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-site-plugin</artifactId>
                            <configuration>
                                <outputEncoding>${project.build.sourceEncoding}</outputEncoding>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <!-- if releasing current pom with maven 3 site descriptor must be attached -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>attach-descriptor</id>
                                <goals>
                                    <goal>attach-descriptor</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!--  This profile will automatically generate Javadoc archives
                  during continuous integration.
            -->
            <id>generate-javadoc-jar</id>
            <activation>
                <property>
                    <name>env.JOB_NAME</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!--  This profile will automatically generate Javadoc reports for
                  modules containing src/main/java and avoids modules from
                  having to repeat a lot of boilerplate in their pom files.
                  
                  Since it is not possible for reports to inherit from
                  pluginManagement, we have to duplicate the configuration here
                  (there are several major issues opened against Maven for this
                  missing functionality).
            -->
            <id>generate-javadoc-report</id>
            <activation>
                <file>
                    <!--  Just require presence of some Java source code -->
                    <exists>src/main/java</exists>
                </file>
            </activation>
            <reporting>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadocPluginVersion}</version>
                        <configuration>
                            <author>false</author>
                            <quiet>true</quiet>
                            <windowtitle>${javadocWindowTitle}</windowtitle>
                            <doctitle>${javadocDocTitle}</doctitle>
                            <header><![CDATA[<b>${javadocDocTitle}</b>]]></header>
                            <footer><![CDATA[<b>${javadocDocTitle}</b>]]></footer>
                            <additionalparam>-linksource</additionalparam>
                            <show>protected</show>
                            <excludePackageNames>com.*</excludePackageNames>
                            <stylesheetfile>${javadocStylesheet}</stylesheetfile>
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>javadoc</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
        <profile>
            <!-- This profile only active if the build server exports the SVN_REVISION variable -->
            <id>ci-build</id>
            <activation>
                <property>
                    <name>env.SVN_REVISION</name>
                </property>
            </activation>
            <properties>
                <ci.build.number>${env.BUILD_NUMBER}</ci.build.number>
                <ci.svn.revision>${env.SVN_REVISION}</ci.svn.revision>
            </properties>
        </profile>
        <profile>
            <id>non-ci-build</id>
            <activation>
                <property>
                    <name>!env.SVN_REVISION</name>
                </property>
            </activation>
            <properties>
                <ci.build.number>0</ci.build.number>
                <ci.svn.revision>0</ci.svn.revision>
            </properties>
        </profile>
        <profile>
          <!-- This profile provides API/ABI compatiblity checks and reports via Clirr -->
          <id>clirr</id>
          <activation>
            <file>
              <exists>clirr-ignored-api-changes.xml</exists><!-- this file name is duplicated due to MNG-4471 -->
            </file>
          </activation>
          <build>
            <plugins>
              <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <version>${clirrPluginVersion}</version>
                <inherited>true</inherited>
                <configuration>
                  <comparisonVersion>${clirrComparisonVersion}</comparisonVersion>
                  <excludes>
                    <exclude>com/**</exclude>
                  </excludes>
                  <ignoredDifferencesFile>clirr-ignored-api-changes.xml</ignoredDifferencesFile>
                </configuration>
                <executions>
                  <execution>
                    <id>mvn clirr:check</id>
                  </execution>
                  <execution>
                    <id>mvn verify</id>
                    <goals>
                      <goal>check</goal>
                    </goals>
                  </execution>
                </executions>
              </plugin>
            </plugins>
          </build>
          <reporting>
            <plugins>
              <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>clirr-maven-plugin</artifactId>
                <version>${clirrPluginVersion}</version>
                <inherited>true</inherited>
                <configuration>
                  <comparisonVersion>${clirrComparisonVersion}</comparisonVersion>
                  <excludes>
                    <exclude>com/**</exclude>
                  </excludes>
                  <ignoredDifferencesFile>clirr-ignored-api-changes.xml</ignoredDifferencesFile>
                </configuration>
              </plugin>
            </plugins>
          </reporting>
        </profile>
    </profiles>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.4</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>dependency-management</report>
                            <report>issue-tracking</report>
                            <report>license</report>
                            <report>scm</report>
                            <report>plugin-management</report>
                            <report>distribution-management</report>
                            <report>summary</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>
