<?xml version="1.0" encoding="UTF-8"?>
<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.qcloud.cos</groupId>
    <artifactId>hadoop-cos</artifactId>
    <version>8.2.7</version>
    <packaging>jar</packaging>

    <name>Apache Hadoop Tencent Cloud COS Support</name>
    <description>
        This module contains code to support integration with Tencent Cloud COS.
        It also declares the dependencies needed to work with COS.
    </description>
    <url>https://github.com/tencentyun/hadoop-cos</url>

    <licenses>
        <license>
            <name>Tencent with MIT License</name>
            <url>https://github.com/tencentyun/hadoop-cos/blob/master/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>iainyu</id>
            <name>Yang Yu</name>
            <email>iainyu@tencent.com</email>
            <organization>Tencent Cloud</organization>
            <organizationUrl>https://cloud.tencent.com/</organizationUrl>
            <url>https://github.com/yuyang733</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/tencentyun/hadoop-cos.git</connection>
        <developerConnection>scm:git:https://github.com/tencentyun/hadoop-cos.git</developerConnection>
        <url>https://github.com/tencentyun/hadoop-cos</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <hadoop.version>3.3.0</hadoop.version>
        <cos_api.version>5.6.112</cos_api.version>
        <google.guava.version>24.1.1-jre</google.guava.version>
        <commons_lang3.version>3.1</commons_lang3.version>
        <junit.version>4.8</junit.version>
        <downloadSources>true</downloadSources>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.qcloud</groupId>
            <artifactId>cos_api-bundle</artifactId>
            <version>${cos_api.version}</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-common</artifactId>
            <version>${hadoop.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.qcloud</groupId>
            <artifactId>cosn-ranger-interface</artifactId>
            <version>1.0.3</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.qcloud</groupId>
            <artifactId>chdfs_hadoop_plugin_network</artifactId>
            <version>3.1</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.qcloud</groupId>
            <artifactId>ofs-sdk-definition</artifactId>
            <version>1.0.4</version>
        </dependency>

        <dependency>
            <groupId>com.tencentcloudapi</groupId>
            <artifactId>tencentcloud-sdk-java-kms</artifactId>
            <version>3.1.213</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.tencent.cloud</groupId>
            <artifactId>cos-sts-java</artifactId>
            <version>3.0.8</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <repository>
            <id>oss</id>
            <name>hadoop-cos</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>

        <snapshotRepository>
            <id>oss</id>
            <name>hadoop-cos</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>normal</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>org/apache/hadoop/fs/cosn/TencentCloudL5EndpointResolverImpl.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Tencent cloud supports internal configurations, including L5 domain name resolution. -->
        <profile>
            <id>internal</id>
            <dependencies>
                <dependency>
                    <groupId>com.tencent.jungle</groupId>
                    <artifactId>jungle-udp-l5</artifactId>
                    <version>1.0.0-20190917.073536-2</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <filtering>true</filtering>
                <includes>
                    <include>hadoopCosPluginVersionInfo.properties</include>
                </includes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</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>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                </configuration>
                <executions>
                    <execution>
                        <id>javadoc-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
                <executions>
                    <execution>
                        <id>deploy</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
