<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- =========================================================================================================== -->
    <!-- Project information -->
    <artifactId>cassandre-trading-bot-spring-boot-autoconfigure</artifactId>
    <packaging>jar</packaging>
    <name>Trading bot spring boot autoconfigure</name>
    <!-- =========================================================================================================== -->

    <!-- =========================================================================================================== -->
    <!-- Dependencies -->
    <dependencies>
        <!-- Spring dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Database -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <version>4.3.4</version>
        </dependency>

        <!-- XChange -->
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-core</artifactId>
            <version>5.0.7</version>
        </dependency>

        <!-- Ta4j -->
        <dependency>
            <groupId>org.ta4j</groupId>
            <artifactId>ta4j-core</artifactId>
            <version>0.13</version>
        </dependency>

        <!-- Util -->
        <dependency>
            <groupId>com.github.vladimir-bukhtoyarov</groupId>
            <artifactId>bucket4j-core</artifactId>
            <version>6.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.20</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
            <version>1.4.2.Final</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>30.1.1-jre</version>
        </dependency>

        <!-- Tests -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>4.0.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <version>2.5.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.qase</groupId>
            <artifactId>qase-junit5</artifactId>
            <version>1.0.2</version>
            <scope>test</scope>
        </dependency>
        <!-- Used for tests -->
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-simulated</artifactId>
            <version>5.0.7</version>
            <scope>test</scope>
        </dependency>
        <!-- For Kucoin integration tests -->
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-kucoin</artifactId>
            <version>5.0.7</version>
            <scope>test</scope>
        </dependency>
        <!-- For Coinbase integration tests -->
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-coinbase</artifactId>
            <version>5.0.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-coinbasepro</artifactId>
            <version>5.0.7</version>
            <scope>test</scope>
        </dependency>
        <!-- For Gemini integration tests -->
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-gemini</artifactId>
            <version>5.0.7</version>
            <scope>test</scope>
        </dependency>
        <!-- For Binance integration tests -->
        <dependency>
            <groupId>org.knowm.xchange</groupId>
            <artifactId>xchange-binance</artifactId>
            <version>5.0.7</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <!-- =========================================================================================================== -->

    <!-- =========================================================================================================== -->
    <!-- IO reactor -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.projectreactor</groupId>
                <artifactId>reactor-bom</artifactId>
                <version>Dysprosium-SR19</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <!-- =========================================================================================================== -->

    <!-- =========================================================================================================== -->
    <!-- Build configuration -->
    <build>
        <!-- Plugins -->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <propertiesEncoding>${project.build.sourceEncoding}</propertiesEncoding>
                    <escapeString>\</escapeString>
                </configuration>
            </plugin>
            <!-- Checkstyle verification -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.2</version>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>8.41.1</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>**/mapper/**/*</excludes>
                    <consoleOutput>true</consoleOutput>
                    <configLocation>../../checkstyle_configuration.xml</configLocation>
                    <failOnViolation>true</failOnViolation>
                    <violationSeverity>warning</violationSeverity>
                </configuration>
            </plugin>
            <!-- Compilation (with mapstruct & spring boot processor) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <compilerArgument>-Xlint:unchecked</compilerArgument>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                            <version>1.4.1.Final</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.16</version>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                            <version>0.2.0</version>
                        </path>
                        <path>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-configuration-processor</artifactId>
                            <version>2.4.1</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <!-- Surefire -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <properties>
                        <configurationParameters>
                            junit.jupiter.extensions.autodetection.enabled = true
                        </configurationParameters>
                    </properties>
                    <reuseForks>false</reuseForks>
                    <forkCount>1</forkCount>
                    <excludes>
                        <exclude>**/integration/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <!-- Jar (classes, sources & documentation)-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Implementation-Version>${project.version}</Implementation-Version>
                        </manifestEntries>
                    </archive>
                </configuration>
            </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</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok-maven-plugin</artifactId>
                <version>1.18.20.0</version>
                <configuration>
                    <sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>
                    <outputDirectory>${project.build.directory}/delombok</outputDirectory>
                    <addOutputDirectory>false</addOutputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>delombok</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
                    <sourcepath>${project.build.directory}/delombok</sourcepath>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <!-- =========================================================================================================== -->

    <!-- =========================================================================================================== -->
    <!-- Profiles -->
    <profiles>
        <profile>
            <id>integration</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <properties>
                                <configurationParameters>
                                    junit.jupiter.extensions.autodetection.enabled = true
                                </configurationParameters>
                            </properties>
                            <reuseForks>false</reuseForks>
                            <forkCount>1</forkCount>
                            <includes>
                                <includes>**/integration/**</includes>
                                <includes>**/issues/**</includes>
                                <exclude>**/test/**</exclude>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <!-- =========================================================================================================== -->

    <!-- =========================================================================================================== -->
    <!-- Parent -->
    <parent>
        <groupId>tech.cassandre.trading.bot</groupId>
        <artifactId>cassandre-trading-bot-project</artifactId>
        <version>4.2.1</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <!-- =========================================================================================================== -->

</project>
