<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License 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>

    <groupId>group.rxcloud</groupId>
    <artifactId>capa-aws-parent</artifactId>
    <packaging>pom</packaging>
    <version>1.10.12.1.RELEASE</version>
    <name>capa-aws-parent</name>
    <description>AWS for Capa.</description>
    <url>https://github.com/reactivegroup</url>

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

    <developers>
        <developer>
            <name>kevinten10</name>
            <email>596823919@qq.com</email>
        </developer>
        <developer>
            <name>reckless11</name>
            <email>reckless0511@gmail.com</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:reactivegroup/capa-aws.git</connection>
        <developerConnection>scm:git:git@github.com:reactivegroup/capa-aws.git</developerConnection>
        <url>git@github.com:reactivegroup/capa-aws.git</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <modules>
        <module>capa-spi-aws-mesh</module>
        <module>capa-spi-aws-config</module>
        <module>capa-spi-aws-telemetry</module>
        <module>capa-spi-aws-infrastructure</module>
        <module>capa-spi-aws-log</module>
        <module>example</module>
    </modules>

    <properties>
        <java.version>8</java.version>
        <file.encoding>UTF-8</file.encoding>
        <maven.version>3.8.1</maven.version>
        <capa.version>1.10.12.RELEASE</capa.version>
        <aws-sdk.version>2.17.40</aws-sdk.version>
        <guava.version>19.0</guava.version>
        <capa-addons.version>1.0.6.RELEASE</capa-addons.version>
        <junit.version>5.3.1</junit.version>
        <mockito-core.version>3.6.0</mockito-core.version>
        <powermock.version>2.0.9</powermock.version>

        <checkstyle.version>3.1.2</checkstyle.version>
        <checkstyle.skip>false</checkstyle.skip>
        <apache.rat.version>0.13</apache.rat.version>
        <cobertura.maven.version>2.7</cobertura.maven.version>
        <maven.resource.version>3.2.0</maven.resource.version>
        <maven.surefire.version>3.0.0-M1</maven.surefire.version>
        <maven.jacoco.version>0.8.6</maven.jacoco.version>
        <byte-buddy.version>1.12.2</byte-buddy.version>
        <http.client.version>4.5.13</http.client.version>
        <netty.bom.version>4.1.68.Final</netty.bom.version>
        <http.core.version>4.4.11</http.core.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Capa's core SDK with all features. -->
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-parent</artifactId>
                <version>${capa.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-addons</artifactId>
                <version>${capa-addons.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- SDK modules -->
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-spi-aws-infrastructure</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-spi-aws-mesh</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-spi-aws-config</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-spi-aws-telemetry</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>group.rxcloud</groupId>
                <artifactId>capa-spi-aws-log</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>

            <!-- aws sdk v2 -->
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>${aws-sdk.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!--http-->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-bom</artifactId>
                <version>${netty.bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${http.client.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${http.core.version}</version>
            </dependency>

            <!-- unit test -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito-core.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- power mock -->
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powermock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito2</artifactId>
                <version>${powermock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${byte-buddy.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <!-- jacoco: mvn verify -Pjacoco  -->
        <profile>
            <id>jacoco</id>
            <properties>
                <jacoco.skip>false</jacoco.skip>
            </properties>
        </profile>
        <!-- check apache license: mvn validate -Prat  -->
        <profile>
            <id>rat</id>
            <properties>
                <rat.skip>false</rat.skip>
            </properties>
        </profile>
        <!-- check code style: mvn validate -Pcheckstyle  -->
        <profile>
            <id>checkstyle</id>
            <properties>
                <checkstyle.skip>false</checkstyle.skip>
            </properties>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.version}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>${file.encoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resource.version}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>copy-checkstyle</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/codestyle</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/codestyle</directory>
                                    <includes>
                                        <include>*</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.41</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>checkstyle-validation</id>
                        <phase>validate</phase>
                        <configuration>
                            <configLocation>codestyle/checkstyle.xml</configLocation>
                            <suppressionsLocation>codestyle/checkstyle-suppressions.xml</suppressionsLocation>
                            <encoding>UTF-8</encoding>
                            <consoleOutput>true</consoleOutput>
                            <failOnViolation>true</failOnViolation>
                            <skip>${checkstyle.skip}</skip>
                            <excludes>
                                **/generated/**/*,
                                **/target/**/*,
                                **/*.json
                                **/*.sh
                            </excludes>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
                <version>${apache.rat.version}</version>
                <executions>
                    <execution>
                        <id>rat-validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/*.versionsBackup</exclude>
                        <exclude>**/.idea/</exclude>
                        <exclude>**/*.iml</exclude>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/*.load</exclude>
                        <exclude>**/*.flex</exclude>
                        <exclude>**/*.fc</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.sh</exclude>
                        <exclude>**/*.bat</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>**/*.json</exclude>
                        <exclude>.git/</exclude>
                        <exclude>.gitignore</exclude>
                        <!-- ASF jenkins box puts the Maven repo in our root directory. -->
                        <exclude>.repository/</exclude>
                        <exclude>**/.settings/*</exclude>
                        <exclude>**/.classpath</exclude>
                        <exclude>**/.project</exclude>
                        <exclude>**/target/**</exclude>
                        <exclude>**/*.log</exclude>
                        <exclude>.codecov.yml</exclude>
                        <exclude>.travis.yml</exclude>
                        <exclude>PULL_REQUEST_TEMPLATE.md</exclude>
                        <exclude>CONTRIBUTING.md</exclude>
                        <exclude>README.md</exclude>
                        <exclude>Jenkinsfile</exclude>
                        <exclude>**/codestyle/*</exclude>
                        <exclude>**/resources/META-INF/**</exclude>
                        <exclude>.github/**</exclude>
                        <exclude>codestyle/**</exclude>
                        <exclude>**/generated/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura.maven.version}</version>
                <configuration>
                    <formats>
                        <format>html</format>
                        <format>xml</format>
                    </formats>
                    <check/>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${maven.jacoco.version}</version>
                <executions>
                    <!-- Prepares the property pointing to the JaCoCo runtime agent
                    which is passed as VM argument when Maven the Surefire plugin is executed. -->
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <!-- Ensures that the code coverage report is created after
                    all tests have been run. -->
                    <execution>
                        <id>generate-report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.6</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.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>