<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>com.swift</groupId>
    <artifactId>parent-pom</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <sourceReleaseAssemblyDescriptor>source-release</sourceReleaseAssemblyDescriptor>
    </properties>

    <name>SWIFT parent pom</name>
    <description>Maven parent pom for SWIFT artifacts.</description>
    <url>https://github.com/swiftinc/parent-pom.git</url>

    <developers>
        <developer>
            <name>Richard Davis</name>
            <email>richard.davis[skip this] at swift.com</email>
        </developer>
        <developer>
            <name>Yin Xu</name>
            <email>yin.xu[skip this] at swift.com</email>
        </developer>
    </developers>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>releases</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <licenses>
        <license>
            <name>SWIFT</name>
            <url>https://raw.githubusercontent.com/swiftinc/parent-pom/master/LICENSE.md</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>SWIFT</name>
        <url>https://www.swift.com</url>
    </organization>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.17</version>
            </plugin>
        </plugins>
    </reporting>

    <scm>
        <url>https://github.com/swiftinc/parent-pom.git</url>
        <connection>scm:git:git://git@github.com/swiftinc/parent-pom.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/swiftinc/parent-pom.git</developerConnection>
        <tag>parent-pom-1.0.0</tag>
    </scm>
    
    <build>
        <plugins>
            <!-- START SNIPPET: release-plugin-configuration -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>

                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <goals>deploy</goals>
                    <arguments>-Pswift-release ${arguments}</arguments>
                    <waitBeforeTagging>10</waitBeforeTagging>
                </configuration>
            </plugin>
            <!-- END SNIPPET: release-plugin-configuration -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-remote-resources-plugin</artifactId>
                <version>1.5</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.9.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-publish-plugin</artifactId>
                <version>1.1</version>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.0</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- START SNIPPET: release-profile -->
        <profile>
            <id>swift-release</id>
            <build>
                <plugins>
                    <!-- Create a source-release artifact that contains the fully buildable project directory source structure. This is the artifact which is the official subject of any release vote. -->
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.apache.resources</groupId>
                                <artifactId>apache-source-release-assembly-descriptor</artifactId>
                                <version>1.0.5</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <id>source-release-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
                                    <descriptorRefs>
                                        <descriptorRef>${sourceReleaseAssemblyDescriptor}</descriptorRef>
                                    </descriptorRefs>
                                    <tarLongFileMode>gnu</tarLongFileMode>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- We want to deploy the artifact to a staging location for perusal -->
                    <plugin>
                        <inherited>true</inherited>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>2.8.2</version>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- We want to sign the artifact, the POM, and all attached artifacts -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!-- END SNIPPET: release-profile -->
    </profiles>

</project>
