<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>org.wildfly.extras.sunstone</groupId>
    <version>2.2.0</version>

    <artifactId>sunstone-parent</artifactId>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <description>Simple Java library which helps to control resources in cloud environments.</description>
    <url>https://github.com/wildfly-extras/sunstone</url>

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

    <developers>
        <developer>
            <id>istraka</id>
            <name>Ivan Straka</name>
            <url>https://github.com/istraka/</url>
        </developer>
    </developers>

    <modules>
        <module>core</module>
        <module>core-wildfly</module>
        <module>azure</module>
        <module>azure-wildfly</module>
        <module>aws</module>
        <module>aws-wildfly</module>
    </modules>

    <scm>
        <connection>scm:git:git@github.com:wildfly-extras/sunstone.git</connection>
        <developerConnection>scm:git:git@github.com:wildfly-extras/sunstone.git</developerConnection>
        <url>https://github.com/wildfly-extras/sunstone/tree/master</url>
    </scm>

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


    <properties>
        <testLogToFile>true</testLogToFile>

        <version.slf4j>1.7.21</version.slf4j>
        <version.logback>1.0.13</version.logback>


        <version.org.wildfly.core>18.1.1.Final</version.org.wildfly.core>
        <version.org.wildfly.extras.creaper>2.0.2</version.org.wildfly.extras.creaper>

        <version.junit.jupiter>5.8.2</version.junit.jupiter>
        <version.junit.platform>1.8.1</version.junit.platform>
        <version.maven-compiler-plugin>3.3</version.maven-compiler-plugin>

        <!-- Azure SDK dependencies & other due to dependencyManagement issues with Azure SDK-->
        <!-- Based on https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/resourcemanager#include-the-package-->
        <version.azure-resourcemanager>2.34.0</version.azure-resourcemanager>
        <version.azure-sdk-bom>1.2.19</version.azure-sdk-bom>
        <version.azure-resourcemanager-postgresqlflexibleserver>1.0.0</version.azure-resourcemanager-postgresqlflexibleserver>

        <!-- Azure SDK uses okhttp3 which is also brought by Sunstone core...we need to find suitable version... -->
        <version.com.squareup.okhttp3>4.10.0</version.com.squareup.okhttp3>

        <!-- AWS SDK dependencies        -->
        <version.software.amazon.awssdk.bom>2.17.174</version.software.amazon.awssdk.bom>

        <version.com.google.code.gson>2.9.0</version.com.google.code.gson>
        <version.commons-net>3.9.0</version.commons-net>

        <version.org.assertj>3.23.1</version.org.assertj>
        <version.maven-surefire-plugin>3.0.0-M7</version.maven-surefire-plugin>

        <!-- Checkstyle configuration -->
        <version.checkstyle.plugin>2.17</version.checkstyle.plugin>
        <version.org.wildfly.checkstyle-config>1.0.4.Final</version.org.wildfly.checkstyle-config>

        <version.commons-lang3>3.12.0</version.commons-lang3>
        <version.shrinkwrap>1.2.6</version.shrinkwrap>

        <version.smallrye-config>2.13.3</version.smallrye-config>
        <version.annotation-api>1.3.2</version.annotation-api>
    </properties>

    <build>
        <pluginManagement>
            <plugins>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${version.maven-surefire-plugin}</version>
                    <configuration>
                        <redirectTestOutputToFile>${testLogToFile}</redirectTestOutputToFile>
                        <trimStackTrace>false</trimStackTrace>
                        <threadCount>1</threadCount>
                        <workingDirectory>${project.build.directory}</workingDirectory>
                        <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
                        <failIfNoTests>false</failIfNoTests>
                        <systemPropertyVariables>
                            <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
                        </systemPropertyVariables>

                        <testFailureIgnore>false</testFailureIgnore>
                        <includes>
                            <!--
                            These are surefire default values explicitly stated
                            Why? There are suite tests (@Suite) that select several test classes not following any of following pattern.
                            Those selected classes can not be run outside of @Suite

                            So if you need to change includes mind those cases!
                            -->
                            <include>**/Test*.java</include>
                            <include>**/*Test.java</include>
                            <include>**/*Tests.java</include>
                            <include>**/*TestCase.java</include>
                        </includes>
                        <excludes>
                            <!-- These should not be run alone since they are supposed to be run in a suite -->
                            <exclude>**/suite/tests/*.java</exclude>
                            <exclude>**/suitetests/*.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>8</source>
                        <target>8</target>
                    </configuration>
                </plugin>

                <!-- Checkstyle -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${version.checkstyle.plugin}</version>
                    <configuration>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <useFile />
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.wildfly.checkstyle</groupId>
                            <artifactId>wildfly-checkstyle-config</artifactId>
                            <version>${version.org.wildfly.checkstyle-config}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>check-style-wildfly</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <configLocation>wildfly-checkstyle/checkstyle.xml</configLocation>
                            </configuration>
                        </execution>
                        <execution>
                            <id>check-style-sunstone</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                            <configuration>
                                <checkstyleRules>
                                    <module name="Checker">
                                        <module name="RegexpMultiline">
                                            <property name="format" value="@author" />
                                            <property name="message" value="Do not use Javadoc @author annotation" />
                                            <property name="fileExtensions" value="java" />
                                        </module>
                                    </module>
                                </checkstyleRules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- removing license headers from source files -->
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.11</version>
                    <configuration>
                        <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
                        <includes>
                            <include>**/*.java</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>remove-license-headers</id>
                            <phase>process-sources</phase>
                            <goals>
                                <goal>remove</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.smallrye.config</groupId>
                <artifactId>smallrye-config</artifactId>
                <version>${version.smallrye-config}</version>
            </dependency>
            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>${version.annotation-api}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${version.commons-lang3}</version>
            </dependency>

            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
                <version>${version.com.squareup.okhttp3}</version>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sunstone-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sunstone-core-wildfly</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sunstone-azure</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sunstone-azure-wildfly</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sunstone-aws</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sunstone-aws-wildfly</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jboss.shrinkwrap</groupId>
                <artifactId>shrinkwrap-bom</artifactId>
                <version>${version.shrinkwrap}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>commons-net</groupId>
                <artifactId>commons-net</artifactId>
                <version>${version.commons-net}</version>
            </dependency>
            <!-- AWS-->
            <dependency>
                <groupId>software.amazon.awssdk</groupId>
                <artifactId>bom</artifactId>
                <version>${version.software.amazon.awssdk.bom}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!--            GSON -->
            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>${version.com.google.code.gson}</version>
            </dependency>

            <!--        Azure-->
            <dependency>
                <groupId>com.azure</groupId>
                <artifactId>azure-sdk-bom</artifactId>
                <version>${version.azure-sdk-bom}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.azure.resourcemanager</groupId>
                <artifactId>azure-resourcemanager</artifactId>
                <version>${version.azure-resourcemanager}</version>
            </dependency>
            <dependency>
                <groupId>com.azure.resourcemanager</groupId>
                <artifactId>azure-resourcemanager-postgresql</artifactId>
                <version>${version.azure-resourcemanager-postgresql}</version>
            </dependency>
            <dependency>
                <groupId>com.azure.resourcemanager</groupId>
                <artifactId>azure-resourcemanager-postgresqlflexibleserver</artifactId>
                <version>${version.azure-resourcemanager-postgresqlflexibleserver}</version>
            </dependency>

            <!--            logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${version.logback}</version>
                <scope>test</scope>
            </dependency>

            <!--        JUnit5-->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${version.junit.jupiter}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-suite-api</artifactId>
                <version>${version.junit.platform}</version>
            </dependency>

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

            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-suite-engine</artifactId>
                <version>${version.junit.platform}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${version.org.assertj}</version>
                <scope>test</scope>
            </dependency>


            <dependency>
                <groupId>org.wildfly.extras.creaper</groupId>
                <artifactId>creaper-core</artifactId>
                <version>${version.org.wildfly.extras.creaper}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.extras.creaper</groupId>
                <artifactId>creaper-commands</artifactId>
                <version>${version.org.wildfly.extras.creaper}</version>
            </dependency>

            <dependency>
                <groupId>org.wildfly.core</groupId>
                <artifactId>wildfly-controller-client</artifactId>
                <version>${version.org.wildfly.core}</version>
            </dependency>
            <dependency>
                <groupId>org.wildfly.core</groupId>
                <artifactId>wildfly-cli</artifactId>
                <version>${version.org.wildfly.core}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>apache-snapshots</id>
            <url>https://repository.apache.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>jboss-public</id>
            <url>https://repository.jboss.org/nexus/content/groups/public/</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <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://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.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-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                    </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>
        </profile>
    </profiles>
</project>
