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

<!--
  Copyright 2023 Google LLC All Rights Reserved

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

  <groupId>com.google.zetasql.toolkit</groupId>
  <artifactId>zetasql-toolkit</artifactId>
  <version>0.5.2</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <url>https://github.com/GoogleCloudPlatform/zetasql-toolkit</url>
  <description>
    The ZetaSQL Toolkit is a library that helps users use ZetaSQL Java API
    to perform SQL analysis for multiple query engines, including
    BigQuery and Cloud Spanner.
  </description>

  <modules>
    <module>zetasql-toolkit-core</module>
    <module>zetasql-toolkit-bigquery</module>
    <module>zetasql-toolkit-spanner</module>
    <module>zetasql-toolkit-examples</module>
  </modules>

  <scm>
    <connection>scm:git:git@github.com:GoogleCloudPlatform/zetasql-toolkit.git
    </connection>
    <developerConnection>
      scm:git:git@github.com:GoogleCloudPlatform/zetasql-toolkit.git
    </developerConnection>
    <url>git@github.com:GoogleCloudPlatform/zetasql-toolkit.git</url>
    <tag>HEAD</tag>
  </scm>

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

  <developers>
    <developer>
      <id>ppaglilla</id>
      <name>Pablo Paglilla</name>
      <email>ppaglilla@google.com</email>
      <organization>Google</organization>
      <organizationUrl>http://www.google.com</organizationUrl>
    </developer>
  </developers>

  <properties>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.deploy.skip>false</maven.deploy.skip>
    <maven.test.skip>true</maven.test.skip>
    <!-- Dependency versions -->
    <zetasql.version>2024.03.1</zetasql.version>
    <google.cloud.libraries.version>26.39.0</google.cloud.libraries.version>
    <!-- Testing dependency versions -->
    <junit.version>5.10.2</junit.version>
    <mockito.version>4.11.0</mockito.version>
    <!-- Plugin versions -->
    <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
    <maven.javadoc.plugin.version>3.7.0</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>3.2.4</maven.gpg.plugin.version>
    <maven.surefire.version>3.2.5</maven.surefire.version>
    <spotless.version>2.30.0</spotless.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.cloud</groupId>
        <artifactId>libraries-bom</artifactId>
        <version>${google.cloud.libraries.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.zetasql</groupId>
        <artifactId>zetasql-client</artifactId>
        <version>${zetasql.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.zetasql</groupId>
        <artifactId>zetasql-types</artifactId>
        <version>${zetasql.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.zetasql</groupId>
        <artifactId>zetasql-jni-channel</artifactId>
        <version>${zetasql.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${mockito.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${maven.source.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${maven.javadoc.plugin.version}</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <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>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.version}</version>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>${spotless.version}</version>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
                <goal>apply</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <java>
              <includes>
                <include>src/main/java/**/*.java</include>
                <include>src/test/java/**/*.java</include>
              </includes>
              <googleJavaFormat>
                <version>1.7</version>
              </googleJavaFormat>
              <importOrder/>
              <removeUnusedImports/>
            </java>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus Staging</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
    </profile>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
