<?xml version='1.0' encoding='UTF-8'?>
<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>se.jguru.nazgul.tools.poms.external</groupId>
        <artifactId>nazgul-tools-external-reactor-parent</artifactId>
        <version>6.0.3</version>
        <relativePath />
    </parent>

    <groupId>se.mithlond.codestyle</groupId>
    <artifactId>mithlond-codestyle-reactor</artifactId>
    <version>2.1.0</version>
    <name>${project.artifactId}</name>
    <description>Mithlond Codestyle: Reactor POM Project Parent.</description>
    <packaging>pom</packaging>
    <url>${site.top.url}/${path.in.reactor}</url>

    <organization>
        <name>Mithlond</name>
        <url>http://www.mithlond.se</url>
    </organization>
    <inceptionYear>2015</inceptionYear>

    <developers>
        <developer>
            <id>lj</id>
            <name>Lennart Jörelid</name>
            <email>lennart.jorelid@gmail.com</email>
            <roles>
                <role>Committer</role>
            </roles>
        </developer>
    </developers>

    <properties>
        <jdk.version>1.8</jdk.version>

        <!--
            Define the name and type of this reactor
        -->
        <path.in.reactor />
        <reactor.name>mithlond-codestyle</reactor.name>
        <organisation.name>Mithlond</organisation.name>

        <!--
            Define URL prefixes used in the various URL settings of the POM.
        -->
        <organisation.url.prefix>https://github.com/${organisation.name}</organisation.url.prefix>
        <git.url.prefix>scm:git:ssh://git@github.com/${organisation.name}</git.url.prefix>
        <site.url.prefix>http://mithlond.github.io</site.url.prefix>
        <site.top.url>${site.url.prefix}/${organisation.name}/${reactor.name}/Documentation/${project.version}</site.top.url>

        <!--
            Define the URL prefixes for Site Deployment and DistributionManagement.
            These can be overridden in sub-reactors to tailor releases to other locations.
        -->
        <issue.mgmnt.url>${organisation.url.prefix}/${reactor.name}/issues</issue.mgmnt.url>
        <scm.connection.url>scm:git:${organisation.url.prefix}/${reactor.name}.git</scm.connection.url>
        <scm.devConnection.url>${git.url.prefix}/${reactor.name}.git</scm.devConnection.url>
        <scm.url>${organisation.url.prefix}/${reactor.name}.git</scm.url>
        <distroManagement.url>${site.top.url}/${path.in.reactor}</distroManagement.url>
        <site.staging.localDirectory>/tmp/${reactor.name}/${project.version}</site.staging.localDirectory>

        <!-- Deploy reactor poms? -->
        <skip.deploy.reactor.poms>false</skip.deploy.reactor.poms>

        <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
        <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
    </properties>

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

    <!-- +=============================================== -->
    <!-- | Section 2:  Module definitions                 -->
    <!-- +=============================================== -->
    <modules>
        <module>codestyle</module>
        <module>poms</module>
        <module>appserver</module>
    </modules>

    <!-- +=============================================== -->
    <!-- | Section 3:  Build settings                     -->
    <!-- +=============================================== -->
    <build>
        <pluginManagement>
            <plugins>

                <!--
                    Configures the release plugin version.
                    Also ensures that the default release profile is not used.
                    (The mithlond-release profile should be used instead).

                    Why:  Release artifacts
                    Used: Normal lifecycle, release goal
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <goals>deploy</goals>
                        <useReleaseProfile>false</useReleaseProfile>
                        <tagNameFormat>${reactor.name}-@{project.version}</tagNameFormat>
                        <arguments>-Pmithlond-release</arguments>
                    </configuration>
                </plugin>

                <!--
                    Configures the Maven changes plugin to run only when executed from the project root directory.

                    Why:  Release artifacts
                    Used: Normal lifecycle, site goal
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-changes-plugin</artifactId>
                    <version>2.12</version>
                    <configuration>
                        <issueManagementSystems>
                            <issueManagementSystem>GitHub</issueManagementSystem>
                        </issueManagementSystems>
                        <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
                    </configuration>
                </plugin>

                <!--
                    Configures the Maven changes plugin to publish the site to a
                    well-defined directory which includes its version.

                    Why:  Publish maven site documentation on GitHub Pages.
                    Used: Release lifecycle, site goal
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-scm-publish-plugin</artifactId>
                    <version>1.1</version>
                    <configuration>
                        <pubScmUrl>${scm.devConnection.url}</pubScmUrl>
                        <scmBranch>gh-pages</scmBranch>
                    </configuration>
                </plugin>

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

                    Why:  Make compile and publish the site documentation.
                    Used: Site lifecycle, mvn site.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                    <executions>
                        <execution>
                            <id>attach-descriptor</id>
                            <goals>
                                <goal>attach-descriptor</goal>
                            </goals>
                            <phase>package</phase>
                        </execution>
                    </executions>
                    <configuration combine.self="override">
                        <topSiteURL>${site.top.url}</topSiteURL>
                        <stagingSiteURL>${project.url}</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>2.7</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.wagon</groupId>
                            <artifactId>wagon-file</artifactId>
                            <version>2.7</version>
                        </dependency>
                    </dependencies>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!--
                Don't deploy reactor poms.
                Except this one.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <configuration>
                    <skip>${skip.deploy.reactor.poms}</skip>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.sonar</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>5.1</version>
            </plugin>

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

                Why:  Make compile and publish the site documentation.
                Used: Site lifecycle, mvn site.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <configuration combine.self="override">
                    <topSiteURL>${site.top.url}</topSiteURL>
                    <stagingSiteURL>${project.url}</stagingSiteURL>
                    <stagingDirectory>${site.staging.localDirectory}</stagingDirectory>
                    <generateSitemap>true</generateSitemap>
                    <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                    <outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-site</id>
                        <phase>site</phase>
                        <goals>
                            <goal>site</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--
                    Configures the release plugin version.
                    Also ensures that the default release profile is not used.
                    (The mithlond-release profile should be used instead).

                    Why:  Release artifacts
                    Used: Normal lifecycle, release goal
                -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration combine.self="override">
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <goals>deploy</goals>
                    <useReleaseProfile>false</useReleaseProfile>
                    <tagNameFormat>${reactor.name}-@{project.version}</tagNameFormat>
                    <arguments>-Pmithlond-release</arguments>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.0.0</version>
                <!-- reportSets>
                    <reportSet>
                        <reports>
                            <report>cim</report>
                            <report>dependency-info</report>
                            <report>index</report>
                            <report>issue-tracking</report>
                            <report>mailing-list</report>
                            <report>project-team</report>
                            <report>scm</report>
                            <report>summary</report>
                        </reports>
                    </reportSet>
                </reportSets -->
            </plugin>
        </plugins>
    </reporting>

    <!-- +=============================================== -->
    <!-- | Section 4:  External systems                   -->
    <!-- +=============================================== -->

    <!--
       Define connections for Maven's VCS integration.
    -->
    <scm>
        <connection>${scm.connection.url}</connection>
        <developerConnection>${scm.devConnection.url}</developerConnection>
        <url>${scm.url}</url>
        <tag>mithlond-codestyle-2.1.0</tag>
    </scm>

    <ciManagement>
        <system>Travis</system>
        <url>https://travis-ci.org/Mithlond/${reactor.name}</url>
    </ciManagement>

    <!--
        Define the issue management system.
    -->
    <issueManagement>
        <system>github</system>
        <url>${issue.mgmnt.url}</url>
    </issueManagement>

    <!--
        Define repository settings for Maven's deploy and release plugins.
        Move parts to settings.xml, as per recommendation within Maven specs.
    -->
    <distributionManagement>
        <repository>
            <id>ossrh-staging</id>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>ossrh-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <site>
            <id>github</id>
            <url>${distroManagement.url}</url>
        </site>
    </distributionManagement>

    <!-- +=============================================== -->
    <!-- | Section 5:  Profiles                           -->
    <!-- +=============================================== -->
    <profiles>
        <profile>
            <id>mithlond-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>default-jar-no-fork</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
