<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ This is a modified version of the Bunsen library, originally published at
  ~ https://github.com/cerner/bunsen.
  ~
  ~ Bunsen is copyright 2017 Cerner Innovation, Inc., and is licensed under
  ~ the Apache License, version 2.0 (http://www.apache.org/licenses/LICENSE-2.0).
  ~
  ~ These modifications are copyright © 2018-2022, Commonwealth Scientific
  ~ and Industrial Research Organisation (CSIRO) ABN 41 687 119 230. Licensed
  ~ under the CSIRO Open Source Software Licence Agreement.
  ~
  -->

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>au.csiro.pathling</groupId>
    <artifactId>pathling</artifactId>
    <version>5.3.2</version>
  </parent>
  <artifactId>encoders</artifactId>
  <packaging>jar</packaging>

  <name>Pathling Encoders</name>
  <description>Encoders for transforming FHIR data into Spark Datasets.</description>

  <developers>
    <developer>
      <name>John Grimes</name>
      <email>John.Grimes@csiro.au</email>
      <url>https://github.com/johngrimes</url>
    </developer>
    <developer>
      <name>Piotr Szul</name>
      <email>Piotr.Szul@data61.csiro.au</email>
      <url>https://github.com/piotrszul</url>
    </developer>
    <developer>
      <name>Ryan Brush</name>
      <email>rbrush@cerner.com</email>
      <url>https://github.com/rbrush</url>
    </developer>
  </developers>

  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${pathling.sparkScalaFullVersion}</version>
    </dependency>

    <!-- HAPI FHIR -->
    <dependency>
      <groupId>ca.uhn.hapi.fhir</groupId>
      <artifactId>hapi-fhir-base</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>ca.uhn.hapi.fhir</groupId>
      <artifactId>hapi-fhir-structures-r4</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Apache Spark -->
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_${pathling.sparkScalaVersion}</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-sql_${pathling.sparkScalaVersion}</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-catalyst_${pathling.sparkScalaVersion}</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Logging -->
    <dependency>
      <artifactId>logback-classic</artifactId>
      <groupId>ch.qos.logback</groupId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>au.csiro.pathling</groupId>
      <artifactId>utilities</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ca.uhn.hapi.fhir</groupId>
      <artifactId>hapi-fhir-validation-resources-r4</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.skyscreamer</groupId>
      <artifactId>jsonassert</artifactId>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Lombok -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-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-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>skipEncodersTests</id>
      <activation>
        <property>
          <name>skipEncodersTests</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>mavenRelease</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>false</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>docs</id>
      <build>
        <plugins>
          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-scaladocs</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>doc-jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
