<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright Amazon.com, Inc. or its affiliates. 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.
  ~ A copy of the License is located at
  ~
  ~  http://aws.amazon.com/apache2.0
  ~
  ~ or in the "license" file accompanying this file. This file 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>
    <parent>
        <groupId>software.amazon.awssdk</groupId>
        <artifactId>aws-sdk-java-pom</artifactId>
        <version>2.24.3</version>
    </parent>
    <artifactId>bundle-sdk</artifactId>
    <packaging>jar</packaging>

    <name>AWS Java SDK :: SDK Bundle</name>
    <description>A single bundled dependency that includes all service and dependent JARs with third-party libraries
        relocated to different namespaces.
    </description>
    <url>https://aws.amazon.com/sdkforjava</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sonar.skip>true</sonar.skip>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom-internal</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>software.amazon.awssdk</groupId>
            <artifactId>aws-sdk-java</artifactId>
            <version>${awsjavasdk.version}</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>software.amazon.s3.accessgrants</groupId>
            <artifactId>aws-s3-accessgrants-java-plugin</artifactId>
            <version>${s3accessgrants.version}</version>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.5.0</version>
                    <configuration>
                        <artifactSet>
                            <includes>
                                <include>com.fasterxml.jackson.jr:*</include>
                                <include>io.netty:*</include>
                                <include>org.apache.httpcomponents:*</include>
                                <include>org.reactivestreams:*</include>
                                <include>org.slf4j:*</include>
                                <include>commons-codec:commons-codec</include>
                                <include>software.amazon.awssdk:*</include>
                                <include>software.amazon:*</include>
                                <include>software.amazon.s3.accessgrants:*</include>
                                <inlcude>com.github.ben-manes.caffeine:*</inlcude>
                                <include>commons-logging:*</include>
                            </includes>
                        </artifactSet>
                        <relocations>
                            <relocation>
                                <pattern>org.apache</pattern>
                                <shadedPattern>software.amazon.awssdk.thirdparty.org.apache</shadedPattern>
                                <excludes>
                                    <exclude>org.apache.log4j.*</exclude>
                                </excludes>
                            </relocation>
                            <relocation>
                                <pattern>io.netty</pattern>
                                <shadedPattern>software.amazon.awssdk.thirdparty.io.netty</shadedPattern>
                            </relocation>
                            <relocation>
                                <pattern>org.slf4j</pattern>
                                <shadedPattern>software.amazon.awssdk.thirdparty.org.slf4j</shadedPattern>
                            </relocation>
                        </relocations>
                        <shadedArtifactAttached>false</shadedArtifactAttached>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
                        </dependencyReducedPomLocation>
                        <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

    </build>
    
    <profiles>
        <profile>
            <id>publishing</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-shade-plugin</artifactId>
                        <configuration>
                            <createSourcesJar>true</createSourcesJar>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>javadoc-jar</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourcepath>${basedir}/../core/profiles/src/main/java/software/amazon/awssdk/profiles;${basedir}/../core/sdk-core/src/main/java/software/amazon/awssdk/core</sourcepath>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
