<?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>com.chartiq.finsemble</groupId>
    <artifactId>finsemble</artifactId>
	<version>10.2.4-BETA-2</version>
    <name>finsemble</name>
    <url>http://www.finsemble.com</url>
    <inceptionYear>2018</inceptionYear>
    <description>Java implementation of the native API for Finsemble.</description>
    <developers>
        <developer>
            <!-- TODO: Change the id, name, url, organization and organizationUrl -->
            <id>chartiq</id>
            <name>ChartIQ</name>
            <email>support@finsemble.com</email>
            <url>https://www.chartiq.com/</url>
            <organization>ChartIQ</organization>
            <organizationUrl>https://www.chartiq.com</organizationUrl>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <timezone>America/New_York</timezone>
        </developer>
    </developers>
    <licenses>
        <license>
            <name>Apache-2.0</name>
        </license>
    </licenses>
    <organization>
        <!-- TODO: Change the name and url -->
        <name>ChartIQ</name>
        <url>www.chartiq.com</url>
    </organization>
    <contributors>
        <contributor>
            <!-- TODO: Change the organization -->
            <organization>ChartIQ</organization>
            <email>support@finsemble.com</email>
            <organizationUrl>www.finsemble.com</organizationUrl>
        </contributor>
    </contributors>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <build.timestamp>${maven.build.timestamp}</build.timestamp>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
    </properties>
    <dependencies>
        <!-- Glue -->
        <dependency>
            <groupId>com.glue42</groupId>
            <artifactId>java-glue42-shaded</artifactId>
            <version>1.7.7</version>
        </dependency>
        <!-- // Glue 42 FDC3 -->
        <dependency>
            <groupId>io.interop.fdc3</groupId>
            <artifactId>java-glue42-fdc3-api</artifactId>
            <version>1.0.2</version>
        </dependency>
        <dependency>
            <groupId>io.interop.fdc3</groupId>
            <artifactId>java-glue42-fdc3-impl</artifactId>
            <version>1.0.2</version>
        </dependency>
        <!-- Needed for Glue logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.17</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>2.0.17</version>
            <scope>runtime</scope>
        </dependency>


        <!-- Needed for JWT -->
        <dependency>
            <groupId>com.nimbusds</groupId>
            <artifactId>nimbus-jose-jwt</artifactId>
            <version>10.0.2</version>
            <scope>test</scope>
        </dependency>


        <!-- Needed for JSON -->
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20231013</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.5</version>
        </dependency>


        <!-- Needed for Websocket -->
        <!-- https://mvnrepository.com/artifact/javax.websocket/javax.websocket-api -->
        <dependency>
            <groupId>org.java-websocket</groupId>
            <artifactId>Java-WebSocket</artifactId>
            <version>1.5.0</version>
        </dependency>

        <!-- Needed to get the native window handle for Finsemble -->
        <dependency>
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna-platform</artifactId>
            <version>5.17.0</version>
            <scope>compile</scope>
        </dependency>


        <!-- // Needed for the test listener (for e2e tests) -->
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>1.2.0</version>
            <scope>test</scope>
        </dependency>
        <!-- // Needed for the junit-platform-launcher (for e2e tests) -->
        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-engine</artifactId>
            <version>1.9.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>5.9.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.9.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.8.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>3.8.0</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <updatePolicy>never</updatePolicy>
            </releases>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <!-- This plugin generates a JAR file which contains all tests, Finsemble and dependency classes -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <attach>true</attach>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <source>1.8</source>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <checkModificationExcludes>
                        <checkModificationExclude>pom.xml</checkModificationExclude>
                        <checkModificationExclude>settings.xml</checkModificationExclude>
                    </checkModificationExcludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.scm</groupId>
                        <artifactId>maven-scm-provider-gitexe</artifactId>
                        <version>1.9.5</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</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>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>1.2.0</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <additionalClasspathElements>
                        <additionalClasspathElement>src/test/java/</additionalClasspathElement>
                    </additionalClasspathElements>
                    <!-- Set a system property to define the InternalClient implementation; using the FakeInternalClient
                         will prevent the Finsemble instance from auto-discovery (racing) with iocd/finsemble - both
                         which will fail on CI since neither iocd nor Finsemble will be running -->


                    <!-- NOTE: "argLine" and "systemProperties" ONLY WORKS FROM THE COMMAND LINE; THIS HAS NO EFFECT
                         IN IntelliJ; for IntelliJ, add "Run Configurations" to the "mvn test" goal which specify
                         the correct command line options-->
                    <!-- Force the fake InternalClient and also preclude any live tests -->
                    <!-- NOTE: GitHub does not seem to use "argLine" -->
                    <!-- <argLine>-Dcom.chartiq.finsemble.test.testutil.liveserveronly.ciName=anyci -Dcom.chartiq.finsemble.finsemble.internalClientClassName=com.chartiq.finsemble.test.multiclient.FakeInternalClient</argLine> -->

                    <!-- Define the same from "argLine" here -->
                    <systemProperties>
                        <!-- At some point, GitHub stopped populating CI_NAME, so we need to pass *anything* in
                             in order to prevent live tests from running -->
                        <property>
                            <name>com.chartiq.finsemble.test.testutil.liveserveronly.ciName</name>
                            <value>anyci</value>
                        </property>
                        <!-- Force the fake InternalClient implementation to avoid racing for live servers -->
                        <property>
                            <name>com.chartiq.finsemble.finsemble.internalClientClassName</name>
                            <value>com.chartiq.finsemble.test.multiclient.FakeInternalClient</value>
                        </property>
                    </systemProperties>

                    <!-- Use the "Legacy" internal client - this is required when running against Finsemble -->
                    <!--
                    <systemProperties>
                        <property>
                            <name>com.chartiq.finsemble.finsemble.internalClientClassName</name>
                            <value>com.chartiq.finsemble.multiclient.finsemble.InternalClientLegacy</value>
                        </property>
                    </systemProperties>
                    -->

                    <!-- Use the "IOCD" internal client - this is required when running against IOCD -->
                    <!-- NOTE: Setup the system property to skip non-iocd tests, as well -->
                    <!--
                    <systemProperties>
                        <property>
                            <name>com.chartiq.finsemble.finsemble.internalClientClassName</name>
                            <value>com.chartiq.finsemble.multiclient.glue.InternalClientIOCD</value>
                        </property>
                        <property>
                            <name>com.chartiq.finsemble.test.testutil.skipifiocd.runningIOCD</name>
                            <value>true</value>
                        </property>
                    </systemProperties>
                    -->
                </configuration>
            </plugin>

            <!-- This publishes to Maven Central -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.8.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <!-- This will publish after upload and validation; we want this for CI -->
                    <autoPublish>true</autoPublish>
                    <!-- The task will block until publish is confirmed; we want this for CI -->
                    <waitUntil>validated</waitUntil>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <scm>
        <connection>scm:git:git://github.com/InteropIO/finsemble-jar.git</connection>
        <developerConnection>scm:git:ssh://github.com:InteropIO/finsemble-jar.git</developerConnection>
        <url>http://github.com/InteropIO/finsemble-jar</url>
      <tag>HEAD</tag>
  </scm>

</project>
