<!--
 * 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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.google.api-ads</groupId>
  <artifactId>google-ads-parent</artifactId>
  <version>12.0.0</version>

  <packaging>pom</packaging>
  <name>Google Ads API client library for Java project</name>
  <url>https://github.com/googleads/google-ads-java</url>
  <description>
    Parent POM of the Google Ads API client library for Java.
  </description>

  <issueManagement>
    <system>github.com</system>
    <url>
      https://github.com/googleads/google-ads-java/issues
    </url>
  </issueManagement>

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

  <scm>
    <connection>
      scm:git:https://github.com/googleads/google-ads-java
    </connection>
    <developerConnection>
      scm:git:https://github.com/googleads/google-ads-java
    </developerConnection>
    <url>
      https://github.com/googleads/google-ads-java
    </url>
    <tag>12.0.0</tag>
  </scm>

  <developers>
    <developer>
      <id>jradcliff</id>
      <name>Josh Radcliff</name>
      <email>jradcliff@users.noreply.github.com</email>
      <organization>Google</organization>
      <organizationUrl>http://www.google.com</organizationUrl>
      <roles>
        <role>owner</role>
        <role>developer</role>
      </roles>
      <timezone>-5</timezone>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M2</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.0,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>[1.8,)</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <showWarnings>false</showWarnings>
          <!-- The AutoValue annotation processing and code generation can lead to compiler
               errors of the form 'endPosTable already set' if incremental compilation is enabled.
               See https://github.com/immutables/immutables/issues/134 -->
          <useIncrementalCompilation>false</useIncrementalCompilation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.0.1</version>
        <configuration>
          <maxmemory>5g</maxmemory>
          <reportOutputDirectory>.</reportOutputDirectory>
          <destDir>javadocs</destDir>
          <!-- Disable doclint. See http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html -->
          <doclint>none</doclint>
          <!-- Only show warnings and errors. -->
          <quiet>true</quiet>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.1.1</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.1.1</version>
      </plugin>
      <plugin>
        <!--
          Specify the release-plugin version explicitly to avoid
          https://issues.apache.org/jira/browse/MRELEASE-812 in
          versions 2.3.2 and 2.4.0, which caused release:perform to
          skip github commits before each push.
        -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
      </plugin>
      <plugin>
        <!--
          Specify the deploy-plugin version explicitly to avoid
          warnings of the form:

            'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin
            is missing.

          during execution of the release:perform goal, which internally
          executes the deploy goal.
        -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
      </plugin>
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <version>2.6</version>
        <configuration>
          <!--
            If the used Java version is too new, don't fail, just do nothing.
          -->
          <failOnUnsupportedJava>false</failOnUnsupportedJava>
          <bundledSignatures>
            <bundledSignature>jdk-deprecated</bundledSignature>
            <bundledSignature>jdk-non-portable</bundledSignature>
          </bundledSignatures>
        </configuration>
        <executions>
          <execution>
            <!--
              These goals run in the 'verify' phase by default. Move them to
              'install' so issues will be caught during development.
            -->
            <phase>install</phase>
            <goals>
              <goal>check</goal>
              <goal>testCheck</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <modules>
    <module>google-ads</module>
    <module>google-ads-annotation-processing</module>
  </modules>

  <profiles>
    <!-- Enables the examples projects by default.
         Provides a profile to disable for Sonatype deploy. -->
    <profile>
      <id>examples-project</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <modules>
        <module>google-ads-examples</module>
        <module>google-ads-migration-examples</module>
      </modules>
    </profile>
    <profile>
      <id>sonatype</id>
      <distributionManagement>
        <repository>
          <id>sonatype-nexus-staging</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
          <id>sonatype-nexus-snapshots</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.2</version>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <serverId>sonatype-nexus-staging</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <!--
            Only sign artifacts when performing the release,
            not when building SNAPSHOT versions.
          -->
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
