<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2017-2020, Schlumberger

  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>org.opengroup.osdu</groupId>
  <artifactId>partition</artifactId>
  <version>0.19.0-SNAPSHOT</version>
  <description>Partition Service</description>

  <properties>
    <java.version>1.8</java.version>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <os-core-common.version>0.18.0</os-core-common.version>
    <org.springframework.boot.version>2.4.5</org.springframework.boot.version>
    <log4j.version>2.17.1</log4j.version>
  </properties>

  <packaging>pom</packaging>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.opengroup.osdu</groupId>
        <artifactId>os-core-common</artifactId>
        <version>${os-core-common.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.13</version>
      </dependency>

      <dependency>
        <groupId>org.opengroup.osdu</groupId>
        <artifactId>os-core-common</artifactId>
        <version>${os-core-common.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.elasticsearch</groupId>
            <artifactId>elasticsearch</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.8</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <version>${org.springframework.boot.version}</version>
          <executions>
            <execution>
              <id>build-info</id>
              <goals>
                <goal>build-info</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>pl.project13.maven</groupId>
        <artifactId>git-commit-id-plugin</artifactId>
        <version>4.0.5</version>
        <executions>
          <execution>
            <goals>
              <goal>revision</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <verbose>true</verbose>
          <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
          <generateGitPropertiesFile>true</generateGitPropertiesFile>
          <generateGitPropertiesFilename>
            ${project.build.outputDirectory}/git.properties
          </generateGitPropertiesFilename>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <modules>
    <module>partition-core</module>
    <module>provider/partition-azure</module>
    <module>provider/partition-aws</module>
    <module>provider/partition-ibm</module>
    <module>provider/partition-gc</module>
  </modules>

  <profiles>
    <profile>
      <id>Default</id>
      <activation>
        <property>
          <name>!repo.releases.id</name>
        </property>
      </activation>
      <properties>
        <repo.releases.id>community-maven-repo</repo.releases.id>
        <publish.snapshots.id>community-maven-via-job-token</publish.snapshots.id>
        <publish.releases.id>community-maven-via-job-token</publish.releases.id>
        <repo.releases.url>https://community.opengroup.org/api/v4/groups/17/-/packages/maven</repo.releases.url>
        <publish.snapshots.url>https://community.opengroup.org/api/v4/projects/221/packages/maven</publish.snapshots.url>
        <publish.releases.url>https://community.opengroup.org/api/v4/projects/221/packages/maven</publish.releases.url>
      </properties>
    </profile>
  </profiles>

  <repositories>
    <repository>
      <id>${repo.releases.id}</id>
      <url>${repo.releases.url}</url>
    </repository>
  </repositories>

  <distributionManagement>
    <repository>
      <id>${publish.releases.id}</id>
      <url>${publish.releases.url}</url>
    </repository>
    <snapshotRepository>
      <id>${publish.snapshots.id}</id>
      <url>${publish.snapshots.url}</url>
    </snapshotRepository>
  </distributionManagement>
</project>