<?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>ibkr-api</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>
    <modules>
        <module>ibkr-tws-api</module>
    </modules>

    <name>InteractiveBrokers API wrapper (unofficial)</name>
    <description>InteractiveBrokers API wrapper</description>
    <url>https://github.com/GFalcon-UA/ibkr</url>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

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

        <maven-version-ruleset.version>1.1.0</maven-version-ruleset.version>
        <ossindex-maven-plugin.version>3.2.0</ossindex-maven-plugin.version>
    </properties>

    <repositories>
        <repository>
            <id>ibkr-local-repo</id>
            <name>Internal IBKR repository</name>
            <url>file://${project.basedir}/lib/maven/repo/</url>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.ib</groupId>
                <artifactId>tws-api</artifactId>
                <version>9.72.18</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <scm>
        <connection>scm:git:git@github.com:GFalcon-UA/ibkr.git</connection>
        <developerConnection>scm:git:ssh://github.com:GFalcon-UA/ibkr.git</developerConnection>
        <url>https://github.com/GFalcon-UA/finviz-api/tree/master</url>
    </scm>

    <licenses>
        <license>
            <name>MIT License</name>
        </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>ibkr-tws-api</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <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>2.8.1</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-properties</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.2</version>
            </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>
                        <!--                        <configuration>-->
                        <!--                            <includes>-->
                        <!--                                ${project.basedir}/../lib/maven/repo/com/ib/tws-api/9.72.18/tws-api-9.72.18-sources.jar-->
                        <!--                            </includes>-->
                        <!--                        </configuration>-->
                    </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.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>
        </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>