<?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.5.0</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>
        <com.typesafe.config.version>1.4.0</com.typesafe.config.version>
        <org.apache.kerby.version>2.0.0</org.apache.kerby.version>
        <org.conscrypt.version>2.2.1</org.conscrypt.version>
        <com.google.guava.version>28.1-jre</com.google.guava.version>
        <org.eclipse.jetty.version>9.4.23.v20191118</org.eclipse.jetty.version>
        <hadoop2.version>2.9.2</hadoop2.version>
        <hadoop3.version>3.1.1</hadoop3.version>
        <junit.version>4.13-beta-3</junit.version>
        <org.powermock.version>2.0.2</org.powermock.version>
        <org.xerial.sqlite-jdbc.version>3.28.0</org.xerial.sqlite-jdbc.version>
        <org.postgresql.version>42.2.8.jre7</org.postgresql.version>
        <org.mariadb.jdbc.version>2.5.1</org.mariadb.jdbc.version>
        <com.github.stefanbirkner.system-rules.version>1.19.0</com.github.stefanbirkner.system-rules.version>
        <io.grpc.version>1.25.0</io.grpc.version>
        <com.google.crypto.tink.version>1.3.0-rc1</com.google.crypto.tink.version>
        <google-api-services-cloudkms.version>v1-rev20191009-1.30.3</google-api-services-cloudkms.version>
        <google-cloud-storage.version>1.101.0</google-cloud-storage.version>
        <protoc.version>3.7.0</protoc.version>
        <netty-tcnative-boringssl-static.version>2.0.27.Final</netty-tcnative-boringssl-static.version>
        <org.redisson.version>3.11.5</org.redisson.version>
        <javax.annotation-api.version>1.3.2</javax.annotation-api.version>
        <google-cloud-datastore.version>1.101.0</google-cloud-datastore.version>
        <google-cloud-kms.version>1.35.0</google-cloud-kms.version>
        <google-api-services-iam.version>v1-rev20191108-1.30.3</google-api-services-iam.version>
        <ch.qos.logback.version>1.2.3</ch.qos.logback.version>
        <ch.qos.logback.contrib.version>0.1.5</ch.qos.logback.contrib.version>
        <jackson-databind.version>2.10.1</jackson-databind.version>
        <net.jodah.expiringmap.version>0.5.9</net.jodah.expiringmap.version>
        <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>${org.powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <version>${org.powermock.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>${com.github.stefanbirkner.system-rules.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>apps/common</module>
        <module>apps/authorizer</module>
        <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>
