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

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.abashev</groupId>
    <artifactId>vfs-s3</artifactId>
    <packaging>jar</packaging>
    <version>4.4.0</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Amazon S3 driver for VFS (Apache Commons Virtual File System)</description>
    <url>https://github.com/abashev/vfs-s3</url>

    <developers>
        <developer>
            <name>Alexey Abashev</name>
            <email>alexey@abashev.ru</email>
        </developer>
    </developers>

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

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <test.fork.count>1</test.fork.count>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-vfs2</artifactId>
            <version>2.9.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.hadoop</groupId>
                    <artifactId>hadoop-hdfs-client</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <version>1.12.523</version>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.5.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>4.0</version>
            <classifier>no_aop</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.9</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.30</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.24.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.11.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>2.0.1</version>
                <configuration>
                    <tag>${project.version}</tag>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.16.1</version>
                <configuration>
                    <includes>
                        <include>${project.groupId}:commons-vfs2</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.10</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <forkCount>${test.fork.count}</forkCount>
                    <reuseForks>true</reuseForks>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <scm>
        <connection>scm:git:git://github.com/abashev/vfs-s3.git</connection>
        <developerConnection>scm:git:ssh://github.com:abashev/vfs-s3.git</developerConnection>
        <url>https://github.com/abashev/vfs-s3</url>
    </scm>

    <profiles>
        <profile>
            <id>surefire-debug</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <test.fork.count>0</test.fork.count>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <vfs-s3-snapshot-repository>https://oss.sonatype.org/content/repositories/snapshots</vfs-s3-snapshot-repository>
                <vfs-s3-release-repository>https://oss.sonatype.org/service/local/staging/deploy/maven2</vfs-s3-release-repository>
            </properties>
            <distributionManagement>
                <snapshotRepository>
                    <id>vfs-s3-repository</id>
                    <url>${vfs-s3-snapshot-repository}</url>
                </snapshotRepository>
                <repository>
                    <id>vfs-s3-repository</id>
                    <url>${vfs-s3-release-repository}</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.5.0</version>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar</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>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.13</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>vfs-s3-repository</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>shade</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <version>3.5.1</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>shade</goal>
                                </goals>
                                <configuration>
                                    <minimizeJar>true</minimizeJar>
                                    <transformers>
                                        <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                    </transformers>
                                    <filters>
                                        <filter>
                                            <artifact>*:*</artifact>
                                            <excludes>
                                                <exclude>META-INF/NOTICE*</exclude>
                                                <exclude>META-INF/LICENSE*</exclude>
                                                <exclude>META-INF/DEPENDENCIES*</exclude>
                                            </excludes>
                                        </filter>
                                    </filters>
                                    <artifactSet>
                                        <includes>
                                            <include>com.amazonaws:aws-java-sdk-s3</include>
                                            <include>com.amazonaws:aws-java-sdk-core</include>
                                            <include>com.amazonaws:jmespath-java</include>
                                            <include>com.amazonaws:aws-java-sdk-kms</include>
                                            <include>software.amazon.ion:ion-java</include>

                                            <include>org.apache.httpcomponents:httpclient</include>
                                            <include>org.apache.httpcomponents:httpcore</include>
                                            <include>commons-codec:commons-codec</include>

                                            <include>com.fasterxml.jackson.dataformat:jackson-dataformat-cbor</include>
                                            <include>com.fasterxml.jackson.core:jackson-annotations</include>
                                            <include>com.fasterxml.jackson.core:jackson-databind</include>
                                            <include>com.fasterxml.jackson.core:jackson-core</include>

                                            <include>joda-time:joda-time</include>
                                        </includes>
                                    </artifactSet>
                                    <relocations>
                                        <relocation>
                                            <pattern>com.amazonaws</pattern>
                                            <shadedPattern>com.github.vfss3.shaded.com.amazonaws</shadedPattern>
                                            <excludes>
                                                <exclude>com.amazonaws.auth.InstanceProfileCredentialsProvider*</exclude>
                                                <exclude>com.amazonaws.auth.AWSStaticCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.AWSCredentialsProviderChain</exclude>
                                                <exclude>com.amazonaws.auth.AWSCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.DefaultAWSCredentialsProviderChain</exclude>
                                                <exclude>com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.AWSSessionCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.EnvironmentVariableCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.SystemPropertiesCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.EC2ContainerCredentialsProviderWrapper</exclude>
                                                <exclude>com.amazonaws.auth.PropertiesFileCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.ContainerCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.profile.internal.ProfileAssumeRoleCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.profile.internal.ProfileStaticCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.profile.internal.securitytoken.STSProfileCredentialsServiceProvider</exclude>
                                                <exclude>com.amazonaws.auth.profile.ProfileCredentialsProvider</exclude>
                                                <exclude>com.amazonaws.auth.*CredentialsFetcher</exclude>

                                                <exclude>com.amazonaws.ClientConfiguration*</exclude>
                                                <exclude>com.amazonaws.ApacheHttpClientConfig</exclude>
                                                <exclude>com.amazonaws.DnsResolver</exclude>
                                                <exclude>com.amazonaws.ProxyAuthenticationMethod</exclude>
                                            </excludes>
                                        </relocation>
                                        <relocation>
                                            <pattern>com.fasterxml</pattern>
                                            <shadedPattern>com.github.vfss3.shaded.com.fasterxml</shadedPattern>
                                        </relocation>
                                        <relocation>
                                            <pattern>org.apache.http</pattern>
                                            <shadedPattern>com.github.vfss3.shaded.org.apache.http</shadedPattern>
                                        </relocation>
                                        <relocation>
                                            <pattern>org.apache.commons.codec</pattern>
                                            <shadedPattern>com.github.vfss3.shaded.org.apache.commons.codec</shadedPattern>
                                        </relocation>
                                        <relocation>
                                            <pattern>org.joda</pattern>
                                            <shadedPattern>com.github.vfss3.shaded.org.joda</shadedPattern>
                                        </relocation>
                                        <relocation>
                                            <pattern>software</pattern>
                                            <shadedPattern>com.github.vfss3.shaded.software</shadedPattern>
                                        </relocation>
                                    </relocations>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
