<!--

    Copyright (c) 2016, 2022, Oracle and/or its affiliates.  All rights reserved.
    This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl
    or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either 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.oracle.oci.sdk</groupId>
  <artifactId>oci-hdfs</artifactId>
  <version>3.3.1.0.3.6</version>
  <packaging>pom</packaging>

  <name>Oracle Cloud Infrastructure HDFS Connector for Storage Service</name>
  <description>This project contains the HDFS connector used to integrate with the Oracle Cloud Infrastructure Object Storage Service</description>
  <url>https://docs.cloud.oracle.com/Content/API/SDKDocs/hdfsconnector.htm</url>
  <inceptionYear>2016</inceptionYear>

  <licenses>
    <license>
      <name>The Universal Permissive License (UPL), Version 1.0</name>
      <url>http://www.oracle.com/technetwork/licenses/upl-license-2927578.html</url>
      <distribution>repo</distribution>
    </license>
    <license>
      <name>Apache License 2.0</name>
      <url>http://apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>oracle</id>
      <name>Oracle</name>
      <organizationUrl>https://www.oracle.com</organizationUrl>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git@github.com:oracle/oci-hdfs-connector.git</connection>
    <developerConnection>scm:git:git@github.com:oracle/oci-hdfs-connector.git</developerConnection>
    <url>https://github.com/oracle/oci-hdfs-connector</url>
  </scm>

  <distributionManagement>
    <repository>
        <id>bintray-${env.BINTRAY_GROUPNAME}-${env.BINTRAY_REPOSITORY_NAME}</id>
        <name>${env.BINTRAY_GROUPNAME}-${env.BINTRAY_REPOSITORY_NAME}</name>
        <url>https://api.bintray.com/maven/${env.BINTRAY_GROUPNAME}/${env.BINTRAY_REPOSITORY_NAME}/${env.JAVA_PROJECT_NAME}/;publish=${env.BINTRAY_PUBLISH}</url>
    </repository>
  </distributionManagement>

  <properties>
    <!-- This should not be a snapshot version. If you want to test locally with a snapshot, you
         can run Maven with the `-Denforcer.fail=false` argument. -->
    <oci.java.sdk.version>2.13.0</oci.java.sdk.version>
    <hadoop.version>3.3.1</hadoop.version>
    <!--
      Deal with CVE-2021-28165:
      Use Jetty version 9.4.40 directly, since Jetty 9.4.20.v20190813 was removed from Hadoop 3.3.0.
      If you update the Hadoop version above to a version that uses Jetty 9.4.39 or newer, please
      remove the exclusions and direct dependencies on Jetty (search for "Deal with CVE-2021-28165").
    -->
    <jetty.version>9.4.44.v20210927</jetty.version>
    <jetty.websocket.version>9.4.44.v20210927</jetty.websocket.version>
    <!-- End: Deal with CVE-2021-28165 -->
  </properties>

  <profiles>
    <profile>
      <id>dev</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.theoryinpractise</groupId>
            <artifactId>googleformatter-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>timestamp-property</id>
                <goals>
                  <goal>timestamp-property</goal>
                </goals>
                <phase>validate</phase>
                <configuration>
                  <name>current.year</name>
                  <pattern>yyyy</pattern>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>process-sources</phase>
                <goals>
                  <goal>format</goal>
                </goals>
                <configuration>
                  <properties>
                    <current.year>${current.year}</current.year>
                  </properties>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>bintray-deploy</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>3.0.0-M1</version>
            <executions>
              <execution>
                <id>deploy-file</id>
                <phase>deploy</phase>
                <goals>
                    <goal>deploy-file</goal>
                </goals>
                <configuration>
                  <file>pom.xml</file>
                  <pomFile>pom.xml</pomFile>
                  <url>https://api.bintray.com/maven/${env.BINTRAY_GROUPNAME}/${env.BINTRAY_REPOSITORY_NAME}/${env.JAVA_PROJECT_NAME}/;publish=${env.BINTRAY_PUBLISH}</url>
                  <repositoryId>bintray-${env.BINTRAY_GROUPNAME}-${env.BINTRAY_REPOSITORY_NAME}</repositoryId>
                  <retryFailedDeploymentCount>5</retryFailedDeploymentCount>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ziponly</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.commonjava.maven.plugins</groupId>
            <artifactId>directory-maven-plugin</artifactId>
            <version>0.1</version>
            <executions>
              <execution>
                <id>directories</id>
                <goals>
                  <goal>directory-of</goal>
                </goals>
                <phase>initialize</phase>
                <configuration>
                  <property>ocihdfs.basedir</property>
                  <project>
                    <groupId>com.oracle.oci.sdk</groupId>
                    <artifactId>oci-hdfs</artifactId>
                  </project>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Auto formats all of the source code -->
        <plugin>
          <groupId>com.theoryinpractise</groupId>
          <artifactId>googleformatter-maven-plugin</artifactId>
          <version>1.0.5</version>
          <executions>
            <execution>
              <id>reformat-sources</id>
              <configuration>
                <includeStale>false</includeStale>
                <style>AOSP</style>
                <filterModified>true</filterModified>
                <skip>false</skip>
              </configuration>
              <goals>
                <goal>format</goal>
              </goals>
              <phase>process-sources</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok-maven-plugin</artifactId>
          <version>1.18.18.0</version>
          <executions>
            <execution>
              <id>delombok</id>
              <phase>process-sources</phase>
              <goals>
                <goal>delombok</goal>
              </goals>
              <configuration>
                <addOutputDirectory>false</addOutputDirectory>
                <outputDirectory>target/generated-sources-for-docs/delombok</outputDirectory>
                <sourceDirectory>src/main/java</sourceDirectory>
                <encoding>UTF-8</encoding>
                <formatPreferences>
                  <javaLangAsFQN>skip</javaLangAsFQN>
                  <generateDelombokComment>skip</generateDelombokComment>
                  <generated>skip</generated>
                  <indent>4</indent>
                  <suppressWarnings>skip</suppressWarnings>
                </formatPreferences>
                <verbose>true</verbose>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.12</version>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>3.0</version>
          <configuration>
            <aggregate>true</aggregate>
            <header>licenseheader.txt</header>
            <includes>
              <include>src/main/java/**/*.java</include>
              <include>src/test/java/**/*.java</include>
              <include>**/*.xml</include>
              <include>**/*.properties</include>
              <include>**/*.html</include>
              <include>**/*.yaml</include>
            </includes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>package</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>test-jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
          <goals>
            <goal>jar</goal>
          </goals>
          <executions>
            <execution>
              <id>aggregate</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <!-- Exclude all of the internal 'store' classes from public Javadoc -->
            <excludePackageNames>*.store.*, *.util.*</excludePackageNames>
            <aggregate>true</aggregate>
            <minmemory>128m</minmemory>
            <maxmemory>1024m</maxmemory>
            <additionalparam>-Xdoclint:none</additionalparam>
            <sourcepath>target/generated-sources-for-docs/delombok</sourcepath>
            <links>
              <link>https://hadoop.apache.org/docs/r${hadoop.version}/api/</link>
            </links>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>
    <!-- Build only dependencies -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.18</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <version>1.21</version>
    </dependency>
  </dependencies>

  <modules>
    <module>hdfs-connector</module>
    <module>hdfs-example</module>
    <module>hdfs-full</module>
    <module>hdfs-addons</module>
  </modules>
</project>
