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

    <groupId>io.envoyproxy.controlplane</groupId>
    <artifactId>java-control-plane</artifactId>
    <version>0.1.15</version>
    <packaging>pom</packaging>

    <modules>
        <module>api</module>
        <module>cache</module>
        <module>server</module>
        <module>test</module>
    </modules>

    <properties>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Dependency Versions -->
        <annotation-api.version>1.3.2</annotation-api.version>
        <assertj.version>3.12.2</assertj.version>
        <auto-value.version>1.6.3</auto-value.version>
        <awaitility.version>3.1.6</awaitility.version>
        <checkstyle.version>8.18</checkstyle.version>
        <grpc.version>1.19.0</grpc.version>
        <guava.version>26.0-android</guava.version><!-- Keep the Guava version in sync with grpc-java -->
        <junit.version>4.12</junit.version>
        <protobuf.version>3.6.1</protobuf.version><!-- Keep the Protobuf version in sync with grpc-java -->
        <rest-assured.version>3.1.0</rest-assured.version>
        <slf4j.version>1.7.26</slf4j.version>
        <testcontainers.version>1.10.7</testcontainers.version>

        <!-- Maven Plugin Versions -->
        <jacoco-maven-plugin.version>0.8.2</jacoco-maven-plugin.version>
        <maven-checkstyle-plugin.version>3.0.0</maven-checkstyle-plugin.version>
        <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.0.0</maven-javadoc-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
        <versions-maven-plugin.version>2.7</versions-maven-plugin.version>
    </properties>

    <name>java-control-plane</name>
    <url>https://github.com/envoyproxy/java-control-plane</url>
    <description>
        The Envoy java-control-plane is a Java-based library for building
        implementations of the data-plane-api.
    </description>

    <organization>
        <name>The Envoy Project</name>
        <url>http://envoyproxy.io/</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <inceptionYear>2018</inceptionYear>

    <scm>
        <url>https://github.com/envoyproxy/java-control-plane</url>
        <connection>scm:git:git://github.com/envoyproxy/java-control-plane.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/envoyproxy/java-control-plane.git</developerConnection>
        <tag>v0.1.15</tag>
    </scm>

    <developers>
        <developer>
            <id>envoyproxy.io</id>
            <name>The Envoy Contributors</name>
            <email>envoy-users@googlegroups.com</email>
            <url>http://envoyproxy.io/</url>
            <organization>The Envoy Project</organization>
            <organizationUrl>http://envoyproxy.io/</organizationUrl>
        </developer>
    </developers>

    <dependencies>
        <!-- Test Dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven-checkstyle-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>buildscripts/checkstyle.xml</configLocation>
                            <consoleOutput>true</consoleOutput>
                            <encoding>UTF-8</encoding>
                            <failOnViolation>true</failOnViolation>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <violationSeverity>warning</violationSeverity>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <author>false</author>
                    <breakiterator>true</breakiterator>
                    <doclint>accessibility,html,reference,syntax</doclint>
                    <keywords>true</keywords>
                    <version>false</version>
                </configuration>
                <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>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources-no-fork</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>jacoco-prepare-ut-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-prepare-it-agent</id>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>ci</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                        <version>${maven-release-plugin.version}</version>
                        <configuration>
                            <autoVersionSubmodules>true</autoVersionSubmodules>
                            <tagNameFormat>v@{project.version}</tagNameFormat>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>${versions-maven-plugin.version}</version>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-nexus-staging</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>signing</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
