<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  Copyright (c) 2019, Salesforce.com, Inc.
  ~  All rights reserved.
  ~  Licensed under the BSD 3-Clause license.
  ~  For full license text, see LICENSE.txt file in the repo root  or https://opensource.org/licenses/BSD-3-Clause
  -->

<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.salesforce.servicelibs</groupId>
    <artifactId>canteen-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0</version>

    <name>Canteen</name>
    <description>A Maven plugin for generating self-executing jars</description>
    <url>https://github.com/salesforce/grpc-java-contrib</url>

    <licenses>
        <license>
            <name>BSD 3-Clause License</name>
            <url>https://github.com/salesforce/grpc-java-contrib/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>rmichela</id>
            <name>Ryan Michela</name>
            <email>rmichela@salesforce.com</email>
        </developer>
    </developers>

    <modules>
        <module>canteen-bootstrap</module>
        <module>canteen-maven-plugin</module>
        <module>canteen-it</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <gitRepo>scm:git:git@github.com:salesforce/grpc-java-contrib.git</gitRepo>
        <mavenRepoId>ossrh</mavenRepoId>
        <mavenBaseUrl>https://oss.sonatype.org/content/repositories</mavenBaseUrl>

        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
    </properties>

    <scm>
        <url>https://github.com/salesforce/grpc-java-contrib</url>
        <connection>${gitRepo}</connection>
        <developerConnection>${gitRepo}</developerConnection>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.21</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failsOnError>true</failsOnError>
                    <failOnViolation>true</failOnViolation>
                    <consoleOutput>true</consoleOutput>
                    <configLocation>../checkstyle.xml</configLocation>
                    <suppressionsLocation>../checkstyle_ignore.xml</suppressionsLocation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>${mavenRepoId}</id>
            <url>${mavenBaseUrl}/releases</url>
        </repository>
        <snapshotRepository>
            <id>${mavenRepoId}</id>
            <url>${mavenBaseUrl}/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>public-release</id>
            <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>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>