<?xml version="1.0" encoding="UTF-8"?>
<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>ua.com.gfalcon</groupId>
    <artifactId>parent-pom</artifactId>
    <version>1.3.0</version>
    <packaging>pom</packaging>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.7.10</version>
    </parent>

    <name>${project.artifactId}</name>
    <description>Common dependency management</description>
    <url>https://github.com/GFalcon-UA/parent-pom</url>

    <properties>
        <java.version>11</java.version>
        <resource.delimiter>@</resource.delimiter>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <docker.image.prefix>gf-</docker.image.prefix>

        <sonar.organization>gfalcon-ua</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        <sonar.coverage.jacoco.xmlReportPaths>
            <!--            ${project.build.directory}/site/jacoco-aggregate/jacoco.xml,-->
            ${project.build.directory}/site/jacoco/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>

        <ossindex.skip>false</ossindex.skip>
        <ossindex.fail>true</ossindex.fail>

        <maven-checkstyle-plugin.skip>false</maven-checkstyle-plugin.skip>
        <maven-checkstyle-plugin.fail-on-violation>true</maven-checkstyle-plugin.fail-on-violation>
        <maven-checkstyle-plugin.fails-on-error>true</maven-checkstyle-plugin.fails-on-error>

        <archunit.version>1.0.1</archunit.version>
        <awaitility.version>4.2.0</awaitility.version>
        <chartfx.version>11.2.7</chartfx.version>
        <checkstyle-config.version>0.1.0</checkstyle-config.version>
        <checkstyle.version>10.9.3</checkstyle.version>
        <deeplearning4j.version>0.9.1</deeplearning4j.version>
        <docker-java.version>3.3.0</docker-java.version>
        <easy-props.version>4.0.0</easy-props.version>
        <easy-random-core.version>5.0.0</easy-random-core.version>
        <googleauth.version>1.5.0</googleauth.version>
        <jcabi-aspects.version>0.24.1</jcabi-aspects.version>
        <jmh.version>1.36</jmh.version>
        <metrics.version>4.2.18</metrics.version>
        <moneta.version>1.4.2</moneta.version> <!-- org.javamoney : moneta -->
        <optaplanner.version>8.36.0.Final</optaplanner.version>
        <quartz.version>2.3.2</quartz.version>
        <reflections.version>0.10.2</reflections.version>
        <rest-assured.version>5.3.0</rest-assured.version>
        <rxjava.version>3.1.6</rxjava.version>
        <spring-boot-admin.version>2.7.10</spring-boot-admin.version>
        <spring-cloud.version>2021.0.3</spring-cloud.version> <!-- org.springframework.cloud : spring-cloud-dependencies -->
        <spring-shell.version>2.1.7</spring-shell.version>
        <springdoc.version>1.7.0</springdoc.version> <!-- org.springdoc : springdoc-openapi-ui -->
        <ta4j-core.version>0.15</ta4j-core.version>
        <telegrambots.version>6.5.0</telegrambots.version>
        <testcontainers.version>1.17.6</testcontainers.version> <!-- org.testcontainers : testcontainers-bom -->
        <vavr.version>0.10.4</vavr.version>
        <yahoofinance-api.version>3.17.0</yahoofinance-api.version>

        <docker-maven-plugin.version>1.2.2</docker-maven-plugin.version>
        <frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <maven-checkstyle-plugin.version>3.2.1</maven-checkstyle-plugin.version>
        <maven-version-ruleset.version>1.1.0</maven-version-ruleset.version>
        <ossindex-maven-plugin.version>3.2.0</ossindex-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.javamoney</groupId>
                <artifactId>moneta</artifactId>
                <version>${moneta.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>de.codecentric</groupId>
                <artifactId>spring-boot-admin-dependencies</artifactId>
                <version>${spring-boot-admin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>de.gsi</groupId>
                <artifactId>chartfx</artifactId>
                <version>${chartfx.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.shell</groupId>
                <artifactId>spring-shell-dependencies</artifactId>
                <version>${spring-shell.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.springdoc</groupId>
                <artifactId>springdoc-openapi-ui</artifactId>
                <version>${springdoc.version}</version>
            </dependency>

            <dependency>
                <groupId>com.yahoofinance-api</groupId>
                <artifactId>YahooFinanceAPI</artifactId>
                <version>${yahoofinance-api.version}</version>
            </dependency>

            <dependency>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-core</artifactId>
                <version>${optaplanner.version}</version>
            </dependency>
            <dependency>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-test</artifactId>
                <version>${optaplanner.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-persistence-jackson</artifactId>
                <version>${optaplanner.version}</version>
            </dependency>
            <dependency>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-benchmark</artifactId>
                <version>${optaplanner.version}</version>
            </dependency>
            <dependency>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-persistence-jpa</artifactId>
                <version>${optaplanner.version}</version>
            </dependency>

            <dependency>
                <groupId>com.jcabi</groupId>
                <artifactId>jcabi-aspects</artifactId>
                <version>${jcabi-aspects.version}</version>
            </dependency>

            <dependency>
                <groupId>io.dropwizard.metrics</groupId>
                <artifactId>metrics-core</artifactId>
                <version>${metrics.version}</version>
            </dependency>

            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured-all</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>spring-web-test-client</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>spring-mock-mvc</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>json-schema-validator</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>xml-path</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>json-path</artifactId>
                <version>${rest-assured.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>io.reactivex.rxjava3</groupId>
                <artifactId>rxjava</artifactId>
                <version>${rxjava.version}</version>
            </dependency>

            <dependency>
                <groupId>com.warrenstrange</groupId>
                <artifactId>googleauth</artifactId>
                <version>${googleauth.version}</version>
            </dependency>

            <dependency>
                <groupId>org.quartz-scheduler</groupId>
                <artifactId>quartz</artifactId>
                <version>${quartz.version}</version>
            </dependency>

            <dependency>
                <groupId>org.reflections</groupId>
                <artifactId>reflections</artifactId>
                <version>${reflections.version}</version>
            </dependency>

            <dependency>
                <groupId>com.github.docker-java</groupId>
                <artifactId>docker-java</artifactId>
                <version>${docker-java.version}</version>
            </dependency>

            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${jmh.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${jmh.version}</version>
            </dependency>

            <dependency>
                <groupId>org.deeplearning4j</groupId>
                <artifactId>deeplearning4j-core</artifactId>
                <version>${deeplearning4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.nd4j</groupId>
                <artifactId>nd4j-native-platform</artifactId>
                <version>${deeplearning4j.version}</version>
            </dependency>


            <dependency>
                <groupId>org.ta4j</groupId>
                <artifactId>ta4j-core</artifactId>
                <version>${ta4j-core.version}</version>
            </dependency>

            <dependency>
                <groupId>org.telegram</groupId>
                <artifactId>telegrambots</artifactId>
                <version>${telegrambots.version}</version>
            </dependency>

            <dependency>
                <groupId>com.tngtech.archunit</groupId>
                <artifactId>archunit</artifactId>
                <version>${archunit.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>io.vavr</groupId>
                <artifactId>vavr</artifactId>
                <version>${vavr.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jeasy</groupId>
                <artifactId>easy-random-core</artifactId>
                <version>${easy-random-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.jeasy</groupId>
                <artifactId>easy-props</artifactId>
                <version>${easy-props.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <scm>
        <connection>scm:git:git@github.com:GFalcon-UA/parent-pom.git</connection>
        <developerConnection>scm:git:ssh://github.com:GFalcon-UA/parent-pom.git</developerConnection>
        <url>https://github.com/GFalcon-UA/parent-pom/tree/main</url>
    </scm>

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

    <developers>
        <developer>
            <id>gfalcon-ua</id>
            <name>Oleksii V. Khalikov</name>
            <email>oleksii.khalikov@gmail.com</email>
            <url>https://github.com/oleksii-khalikov</url>
            <organizationUrl>https://github.com/GFalcon-UA</organizationUrl>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>ci-cd</id>
            <build>
                <plugins>
                    <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>
                                <configuration>
                                    <!-- Prevent gpg from using pinentry programs. Fixes: gpg: signing
                                        failed: Inappropriate ioctl for device -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/application*.yml</include>
                    <include>**/application*.yaml</include>
                    <include>**/application*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
                <excludes>
                    <exclude>**/application*.yml</exclude>
                    <exclude>**/application*.yaml</exclude>
                    <exclude>**/application*.properties</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/docker</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <showWarnings>true</showWarnings>
                        <failOnWarning>true</failOnWarning>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-maven-plugin.version}</version>
                    <configuration>
                        <rulesUri>classpath:///maven-version-rules-java.xml</rulesUri>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>ua.com.gfalcon</groupId>
                            <artifactId>maven-version-ruleset</artifactId>
                            <version>${maven-version-ruleset.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>update</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>update-parent</goal>
                                <goal>update-properties</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <argLine>
                            --illegal-access=permit
                        </argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <configuration>
                        <argLine>
                            --illegal-access=permit
                        </argLine>
                        <includes>
                            <include>**/*IT</include>
                            <include>src/itest/java/**/*</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <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>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.ossindex.maven</groupId>
                    <artifactId>ossindex-maven-plugin</artifactId>
                    <version>${ossindex-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>audit-dependencies</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>audit</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <skip>${ossindex.skip}</skip>
                        <fail>${ossindex.fail}</fail>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${maven-checkstyle-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>ua.com.gfalcon</groupId>
                            <artifactId>checkstyle-config</artifactId>
                            <version>${checkstyle-config.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                        <outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
                        <configLocation>checkstyle.xml</configLocation>
                        <skip>${maven-checkstyle-plugin.skip}</skip>
                        <failOnViolation>${maven-checkstyle-plugin.fail-on-violation}</failOnViolation>
                        <failsOnError>${maven-checkstyle-plugin.fails-on-error}</failsOnError>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <configuration>
                        <append>true</append>
                        <excludes>
                            <exclude>**/config/*</exclude>
                            <exclude>**/*DTO.*</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>aggregate</id>
                            <goals>
                                <goal>report-aggregate</goal>
                            </goals>
                            <phase>verify</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${frontend-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>build-info</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <excludes>
                            <exclude>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                            </exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>${docker-maven-plugin.version}</version>
                    <configuration>
                        <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                        <dockerDirectory>${project.build.directory}/classes</dockerDirectory>
                        <resources>
                            <resource>
                                <targetPath>/</targetPath>
                                <directory>${project.build.directory}</directory>
                                <include>${project.build.finalName}.jar</include>
                            </resource>
                        </resources>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>add-integration-test-source</id>
                            <phase>generate-test-sources</phase>
                            <goals>
                                <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>src/itest/java</source>
                                </sources>
                            </configuration>
                        </execution>
                        <execution>
                            <id>add-integration-test-resource</id>
                            <phase>generate-test-resources</phase>
                            <goals>
                                <goal>add-test-resource</goal>
                            </goals>
                            <configuration>
                                <resources>
                                    <resource>
                                        <directory>src/itest/resources</directory>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

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

</project>