<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.google.cloud.broker</groupId>
    <artifactId>broker-parent</artifactId>
    <version>0.4.1</version>
    <packaging>pom</packaging>

    <name>GCP Token Broker Parent</name>
    <description>Parent project for the GCP Token Broker service and related artifacts.</description>

    <url>https://github.com/GoogleCloudPlatform/gcp-token-broker</url>

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

    <developers>
        <developer>
            <organization>Google Inc.</organization>
            <organizationUrl>http://www.google.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:GoogleCloudPlatform/gcp-token-broker.git</connection>
        <developerConnection>
            scm:git:git@github.com:GoogleCloudPlatform/gcp-token-broker.git
        </developerConnection>
        <url>git@github.com:GoogleCloudPlatform/gcp-token-broker.git</url>
    </scm>

    <issueManagement>
        <system>GitHub Issues</system>
        <url>https://github.com/GoogleCloudPlatform/gcp-token-broker/issues</url>
    </issueManagement>

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

    <properties>
        <hadoop2.version>2.9.2</hadoop2.version>
        <hadoop3.version>3.1.1</hadoop3.version>
        <junit.version>4.13-beta-3</junit.version>
        <powermock.version>2.0.2</powermock.version>
        <sqlite.jdbc.version>3.28.0</sqlite.jdbc.version>
        <postgresql.jdbc.version>42.2.5</postgresql.jdbc.version>
        <mariadb.jdbc.version>2.4.2</mariadb.jdbc.version>
        <system.rules.version>1.19.0</system.rules.version>
        <io.grpc.version>1.22.1</io.grpc.version>
        <protoc.version>3.7.0</protoc.version>
        <netty.tcnative.version>2.0.25.Final</netty.tcnative.version>
        <redisson.version>3.10.6</redisson.version>
        <javax.annotation.version>1.2</javax.annotation.version>
        <cloud.datastore.version>1.86.0</cloud.datastore.version>
        <cloud.kms.version>1.22.0</cloud.kms.version>
        <cloud.iam.version>v1-rev20190704-1.30.1</cloud.iam.version>
        <logback.version>1.2.3</logback.version>
        <logback.contrib.version>0.1.5</logback.contrib.version>
        <jackson.databind.version>2.9.9.3</jackson.databind.version>
        <expiringmap.version>0.5.9</expiringmap.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.assembly.plugin.version>3.1.1</maven.assembly.plugin.version>
        <maven.os.plugin.version>1.6.1</maven.os.plugin.version>
        <maven.protobuf.plugin.version>0.5.1</maven.protobuf.plugin.version>
        <maven.javadoc.plugin.version>3.1.0</maven.javadoc.plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <gpg.skip>false</gpg.skip>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.1.0</version>
                        <configuration>
                            <additionalOptions>-Xdoclint:none</additionalOptions>
                            <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>2.7</version>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.4</version>
                        <configuration>
                            <excludes>
                                <exclude>com.google.cloud.broker.protobuf</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <!-- attached to Maven test phase -->
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <!-- Testing dependencies -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <version>${powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>${system.rules.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <modules>
        <module>apps/broker</module>
        <module>apps/core</module>
        <module>apps/extensions/database/jdbc</module>
        <module>apps/extensions/database/cloud-datastore</module>
        <module>apps/extensions/encryption/cloud-kms</module>
        <module>apps/extensions/caching/redis</module>
        <module>connector</module>
    </modules>

</project>