<?xml version='1.0' encoding='UTF-8'?>
<!--
  ~ Copyright (c) jGuru Europe AB.
  ~ All rights reserved.
  -->

<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>

    <!--
    ################################################
    # Section 1:  Project information
    ################################################
    -->
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>se.jguru.nazgul.tools</groupId>
    <artifactId>nazgul-tools-reactor</artifactId>
    <version>4.1.1</version>
    <name>${project.artifactId}</name>
    <url>${url.prefix}/${path.in.reactor}</url>
    <description>The Nazgul Framework: Tools project holds a collection of Maven best-pracises and sensible
        configurations, aimed at boosting productivity. The Nazgul Framework: Tools project enables you to start
        projects quickly and scale them considerably without needing to change the development or deployment model.
    </description>
    <packaging>pom</packaging>
    <inceptionYear>2010</inceptionYear>

    <organization>
        <name>jGuru Europe AB</name>
        <url>http://www.jguru.se/</url>
    </organization>

    <prerequisites>
        <maven>3.0.5</maven>
    </prerequisites>

    <licenses>
        <license>
            <name>jGuru Europe Corporate Source License, based on The Apache Software License, Version 2.0</name>
            <url>http://www.jguru.se/licenses/jguruCorporateSourceLicense-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>lj</id>
            <name>Lennart Jörelid</name>
            <email>lj@jguru.se</email>
            <roles>
                <role>Committer</role>
            </roles>
            <organization>jGuru Europe AB</organization>
            <organizationUrl>http://www.jguru.se</organizationUrl>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <properties>
        <!-- Build definition properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jdk.version>1.7</jdk.version>

        <!-- Code style properties -->
        <wtp.version>2.0</wtp.version>
        <clean.plugin.version>2.6.1</clean.plugin.version>
        <maven-project-info-reports-plugin.version>2.7</maven-project-info-reports-plugin.version>
        <versions-maven-plugin.version>2.1.4</versions-maven-plugin.version>

        <!-- Site plugin properties -->
        <maven-site-plugin.version>3.4</maven-site-plugin.version>
        <doxia-modules.version>1.6</doxia-modules.version>
        <wagon-modules.version>2.9</wagon-modules.version>
        <reflow-velocity-tools.version>1.1.1</reflow-velocity-tools.version>
        <velocity.version>1.7</velocity.version>

        <!--
            Define the URL prefixes for Site Deployment and DistributionManagement.
            These can be overridden in sub-reactors to tailor releases to other locations.
        -->
        <path.in.reactor />
        <reactor.name>nazgul_tools</reactor.name>
        <reactor.url.remote.prefix>http://bitbucket.org/lennartj</reactor.url.remote.prefix>
        <site.url.prefix>scp://www-data@angmar/var/www/nazgul</site.url.prefix>
        <site.staging.localDirectory>/tmp/${reactor.name}</site.staging.localDirectory>
        <scm.url.prefix>scm:hg:${reactor.url.remote.prefix}</scm.url.prefix>
        <url.prefix>${reactor.url.remote.prefix}/${reactor.name}/${project.version}</url.prefix>
        <distro.url.prefix>${site.url.prefix}/${reactor.name}/${project.version}</distro.url.prefix>
    </properties>

    <!--
    ################################################
    # Section 2:  Modules
    ################################################
    -->
    <modules>
        <module>codestyle</module>
        <module>validation</module>
        <module>poms</module>
        <module>features-assembly</module>
    </modules>

    <!--
    ################################################
    # Section 3:  Build settings
    ################################################
    -->
    <build>
        <pluginManagement>
            <plugins>

                <!--
                    Use a working version of the Maven versions plugin.
                    (TODO: Update the Codehaus versions plugin with the fine additions done by Lars.)

                    Why:  Workaround for https://jira.codehaus.org/browse/MVERSIONS-236
                    Used: Only when called.
                -->
                <plugin>
                    <groupId>de.lgohlke.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.sonar</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>4.5.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>

            <!--
                Configures the release plugin.

                Why:  Make the release plugin replace any information received from the Sonatype OSS parent.
                Used: Release lifecycle, mvn release.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.1</version>
                <configuration combine.self="override">
                    <localCheckout>true</localCheckout>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <tagNameFormat>${reactor.name}-@{project.version}</tagNameFormat>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-hg</artifactId>
                        <version>1.9.2</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--
                Configure the javadoc plugin not to fail on standard HTML
                constructs when building using JDK 8.

                Typical standard constructs include empty tags, like: <p />
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.1</version>
                <configuration>
                    <failOnError>false</failOnError>
                    <stylesheet>java</stylesheet>
                    <groups>
                        <group>
                            <title>Nazgul Framework: Tools Packages</title>
                            <packages>se.jguru.nazgul.tools.*</packages>
                        </group>
                        <group>
                            <title>Nazgul Framework: Core Packages</title>
                            <packages>se.jguru.nazgul.core.*</packages>
                        </group>
                        <group>
                            <title>Nazgul Framework: Test Artifact Packages</title>
                            <packages>se.jguru.nazgul.test.*</packages>
                        </group>
                    </groups>
                    <doclet>org.jboss.apiviz.APIviz</doclet>
                    <docletArtifact>
                        <groupId>org.jboss.apiviz</groupId>
                        <artifactId>apiviz</artifactId>
                        <version>1.3.2.GA</version>
                    </docletArtifact>
                    <useStandardDocletOptions>true</useStandardDocletOptions>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <docencoding>${project.build.sourceEncoding}</docencoding>
                    <charset>${project.build.sourceEncoding}</charset>
                    <breakiterator>true</breakiterator>
                    <version>true</version>
                    <author>true</author>
                    <keywords>true</keywords>
                    <additionalparam>-sourceclasspath ${project.build.outputDirectory}</additionalparam>
                </configuration>
            </plugin>

            <!--
                Configures the site plugin. Its use is further documented in the site documentation itself.

                Why:  Make compile and publish the Nazgul documentation.
                Used: Site lifecycle, mvn site.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <topSiteURL>${site.url.prefix}/${reactor.name}</topSiteURL>
                    <stagingSiteURL>${site.url.prefix}/${reactor.name}</stagingSiteURL>
                    <stagingDirectory>${site.staging.localDirectory}</stagingDirectory>
                    <generateSitemap>true</generateSitemap>
                    <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                    <outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>${wagon-modules.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-file</artifactId>
                        <version>${wagon-modules.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>${doxia-modules.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-xhtml</artifactId>
                        <version>${doxia-modules.version}</version>
                    </dependency>
                    <!--
                        Reflow skin and dependencies.

                        These velocity tools should only be used if the
                        reflow maven skin is used for site documentation.
                    -->
                    <!-- dependency>
                        <groupId>lt.velykis.maven.skins</groupId>
                        <artifactId>reflow-velocity-tools</artifactId>
                        <version>${reflow-velocity-tools.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.velocity</groupId>
                        <artifactId>velocity</artifactId>
                        <version>${velocity.version}</version>
                    </dependency -->
                </dependencies>
            </plugin>

            <!--
                Provides Plantuml integration into site deployments.

                Why:  Convert Plantuml (*.puml) documents to png images, for use in site documentation.
                Used: Site lifecycle, mvn site.
            -->
            <plugin>
                <groupId>com.github.jeluard</groupId>
                <artifactId>plantuml-maven-plugin</artifactId>
                <version>7954</version>
                <configuration>
                    <sourceFiles>
                        <directory>${basedir}</directory>
                        <includes>
                            <include>src/site/**/*.puml</include>
                        </includes>
                    </sourceFiles>
                    <outputDirectory>${project.build.directory}/site/images/plantuml</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-plantuml-diagrams</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <phase>pre-site</phase>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>net.sourceforge.plantuml</groupId>
                        <artifactId>plantuml</artifactId>
                        <version>8012</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <outputDirectory>${project.build.directory}/site</outputDirectory>
        <plugins>

            <!--
                Configures the projects-info-reports plugin.

                Why:  Reduce the time consumed considerably by removing the need to acquire
                      dependency details and locations.
                Used: Site lifecycle, mvn site.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>

            <!--
                    Use a working version of the Maven versions plugin.
                    (TODO: Update the Codehaus versions plugin with the fine additions done by Lars.)

                    Why:  Workaround for https://jira.codehaus.org/browse/MVERSIONS-236
                    Used: Only when called.
                -->
            <plugin>
                <groupId>de.lgohlke.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions-maven-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>

        <!--
            Use GPG to sign artifacts during release:perform.

            Why:  Makes the releases traceable to their originator. Required by maven central and Sonatype OSS.
            Used: Standard lifecycle, mvn release.
        -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!--
    ################################################
    # Section 4:  External systems
    ################################################
    -->
    <!--
       Define connections for Maven's Mercurial integration.
    -->
    <scm>
        <connection>${scm.url.prefix}/${reactor.name}</connection>
        <developerConnection>${scm.url.prefix}/${reactor.name}</developerConnection>
        <url>${reactor.url.remote.prefix}/${reactor.name}</url>
        <tag>nazgul-tools-4.1.1</tag>
    </scm>

    <!--
        Define the issue management system.
    -->
    <issueManagement>
        <system>bitbucket</system>
        <url>${reactor.url.remote.prefix}/${reactor.name}/issues</url>
    </issueManagement>

    <!--
        Define repository settings for Maven's deploy and release plugins.
    -->
    <distributionManagement>
        <site>
            <id>jGuru_NazgulToolsSite</id>
            <name>jGuru_NazgulToolsSite</name>
            <url>${distro.url.prefix}/${path.in.reactor}</url>
        </site>
    </distributionManagement>
</project>
