<!--
 * 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
 *
 *     https://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">

  <parent>
    <groupId>com.google.api-ads</groupId>
    <artifactId>google-ads-parent</artifactId>
    <version>10.1.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.api-ads</groupId>
  <artifactId>google-ads</artifactId>
  <packaging>jar</packaging>
  <version>10.1.0</version>
  <name>Google Ads API client library for Java</name>
  <description>
    Google Ads API client library for Java.
  </description>

  <properties>
    <auto-value.version>1.7.3</auto-value.version>
    <!-- Keep all versions below consistent with the io.netty version. -->
    <netty.version>2.0.26.Final</netty.version>
    <gax.version>1.60.1</gax.version>
    <grpc.version>1.30.0</grpc.version>
    <protobuf.version>3.12.2</protobuf.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.google.api</groupId>
      <artifactId>gax</artifactId>
      <version>${gax.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.api</groupId>
      <artifactId>gax-grpc</artifactId>
      <version>${gax.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.auto.value</groupId>
      <artifactId>auto-value</artifactId>
      <version>${auto-value.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-tcnative-boringssl-static</artifactId>
      <!--
        See https://github.com/grpc/grpc-java/blob/master/SECURITY.md#troubleshooting
      -->
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
    </dependency>
    <dependency>
      <groupId>com.google.api-ads</groupId>
      <artifactId>google-ads-annotation-processing</artifactId>
      <version>10.1.0</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <version>2.0.0.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.api</groupId>
      <artifactId>gax-grpc</artifactId>
      <classifier>testlib</classifier>
      <version>${gax.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <!--
      Without this dependency, gax will add io.grpc:grpc-context:jar:1.22.1 to
      the classpath instead of io.grpc:grpc-context:jar:1.25.0, and tests will
      fail due to changes to io.grpc.Deadline.
      -->
      <groupId>io.grpc</groupId>
      <artifactId>grpc-context</artifactId>
      <version>${grpc.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>0.27</version>
      <scope>test</scope>
    </dependency>

    <!-- Java EE Modules deprecated since JDK 9 -->
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
      <version>1.3.2</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>com.github.os72</groupId>
        <artifactId>protoc-jar-maven-plugin</artifactId>
        <version>3.11.1</version>
        <executions>
          <execution>
            <id>generate-test-protos</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <protocArtifact>com.google.protobuf:protoc:${protobuf.version}</protocArtifact>
              <inputDirectories>
                <include>src/test/resources/protos</include>
              </inputDirectories>
              <outputTargets>
                <outputTarget>
                  <type>java</type>
                  <addSources>none</addSources>
                  <outputDirectory>target/generated-test-sources</outputDirectory>
                </outputTarget>
              </outputTargets>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-test-sources</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
