<?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>
  <parent>
    <groupId>au.gov.amsa.risky</groupId>
    <artifactId>parent</artifactId>
    <version>0.6.18</version>
  </parent>
  <artifactId>ais</artifactId>
  <name>${project.artifactId}</name>
  <description>Utilities for parsing AIS NMEA and XML messages and for processing AIS message streams.</description>
  <properties>
    <benchmarkClass />
  </properties>
  <dependencies>
    <dependency>
      <groupId>au.gov.amsa.risky</groupId>
      <artifactId>formats</artifactId>
      <version>${project.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>au.gov.amsa.risky</groupId>
      <artifactId>streams</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.github.davidmoten</groupId>
      <artifactId>rxjava-extras</artifactId>
    </dependency>
    <dependency>
      <groupId>com.github.davidmoten</groupId>
      <artifactId>rxjava-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>

    <dependency>
      <groupId>io.reactivex</groupId>
      <artifactId>rxjava</artifactId>
    </dependency>
    <dependency>
      <groupId>io.reactivex</groupId>
      <artifactId>rxjava-string</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.github.davidmoten</groupId>
      <artifactId>sparse-hilbert-index</artifactId>
      <version>0.1.11</version>
      <scope>test</scope>
    </dependency>

    <!-- test/benchmark deps -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-csv</artifactId>
      <version>1.10.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.openjdk.jmh</groupId>
      <artifactId>jmh-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- <dependency> <groupId>dk.dma.ais.lib</groupId> <artifactId>ais-lib-messages</artifactId> 
            <version>2.2-SNAPSHOT</version> <scope>test</scope> </dependency> -->
  </dependencies>

  <profiles>
    <profile>
      <id>benchmark</id>
      <dependencies>
        <dependency>
          <groupId>org.openjdk.jmh</groupId>
          <artifactId>jmh-generator-annprocess</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>run-benchmarks</id>
                <goals>
                  <goal>exec</goal>
                </goals>
                <phase>integration-test</phase>
                <configuration>
                  <classpathScope>test</classpathScope>
                  <executable>java</executable>
                  <arguments>
                    <argument>-classpath</argument>
                    <classpath />
                    <argument>org.openjdk.jmh.Main</argument>
                    <!-- -h for help -->
                    <argument>-f</argument>
                    <argument>1</argument>
                    <argument>-i</argument>
                    <argument>10</argument>
                    <argument>-wi</argument>
                    <argument>3</argument>
                    <argument>-jvmArgs</argument>
                    <argument>-Xmx512m</argument>
                    <argument>${benchmarkClass}</argument>
                  </arguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>bin</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <classpathScope>test</classpathScope>
              <mainClass>au.gov.amsa.ais.rx.NmeaGzToBinaryFixesMain</mainClass>
              <systemProperties>
                <systemProperty>
                  <key>input</key>
                  <value>${input}</value>
                </systemProperty>
                <systemProperty>
                  <key>output</key>
                  <value>${output}</value>
                </systemProperty>
                <systemProperty>
                  <key>pattern</key>
                  <value>${pattern}</value>
                </systemProperty>
              </systemProperties>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>ssl</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <mainClass>au.gov.amsa.ais.MariwebSslConnectMain</mainClass>
              <systemProperties>
                <systemProperty>
                  <key>host</key>
                  <value>${host}</value>
                </systemProperty>
                <systemProperty>
                  <key>port</key>
                  <value>${port}</value>
                </systemProperty>
                <systemProperty>
                  <key>username</key>
                  <value>${username}</value>
                </systemProperty>
                <systemProperty>
                  <key>password</key>
                  <value>${password}</value>
                </systemProperty>
              </systemProperties>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>search</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <mainClass>au.gov.amsa.ais.rx.CsvHilbertIndexSearchMain</mainClass>
              <classpathScope>test</classpathScope>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>main</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <configuration>
              <mainClass>au.gov.amsa.ais.BenchmarksDecodeManyNmea</mainClass>
              <classpathScope>test</classpathScope>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>java</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
