<?xml version="1.0"?>
<!--
  ~ 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>
        <artifactId>aws-sdk-java-pom</artifactId>
        <groupId>software.amazon.awssdk</groupId>
        <version>2.55.16</version>
    </parent>

    <artifactId>core</artifactId>
    <name>AWS Java SDK :: Core</name>
    <packaging>pom</packaging>
    <description>
        The AWS SDK for Java - Core is an umbrella module that contains child modules which are considered as
        core of the library.
    </description>

    <modules>
        <module>annotations</module>
        <module>arns</module>
        <module>auth</module>
        <module>identity-spi</module>
        <module>http-auth-spi</module>
        <module>http-auth</module>
        <module>http-auth-aws</module>
        <module>http-auth-aws-crt</module>
        <module>http-auth-aws-eventstream</module>
        <module>auth-crt</module>
        <module>sdk-core</module>
        <module>aws-core</module>
        <module>profiles</module>
        <module>regions</module>
        <module>protocols</module>
        <module>metrics-spi</module>
        <module>json-utils</module>
        <module>endpoints-spi</module>
        <module>imds</module>
        <module>crt-core</module>
        <module>retries-spi</module>
        <module>retries</module>
        <module>checksums-spi</module>
        <module>checksums</module>
    </modules>

    <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>

    <profiles>
        <!-- Binds the version.properties executions defined in the root pom. Activated per module, so the aggregator
             poms are skipped. -->
        <profile>
            <id>generate-version-properties</id>
            <activation>
                <file>
                    <exists>${basedir}/src/main/java</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>parse-sdk-version</id>
                                <phase>validate</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-version-properties</id>
                                <phase>generate-resources</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>require-version-properties</id>
                                <phase>process-resources</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
