<?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>au.csiro.pathling</groupId>
  <artifactId>test-data</artifactId>
  <version>1.0.0</version>

  <name>Pathling Test Data</name>
  <description>
    A synthetic test data set for use in testing and benchmarking Pathling.
  </description>
  <url>https://pathling.csiro.au</url>

  <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@csiro.au</email>
      <url>https://github.com/piotrszul</url>
    </developer>
  </developers>

  <organization>
    <name>Australian e-Health Research Centre, CSIRO</name>
    <url>https://aehrc.csiro.au</url>
  </organization>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/aehrc/pathling</url>
    <developerConnection>scm:git:https://github.com/aehrc/pathling.git</developerConnection>
  </scm>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/aehrc/pathling/issues</url>
  </issueManagement>
  <ciManagement>
    <system>GitHub Actions</system>
    <url>https://github.com/aehrc/pathling/actions</url>
  </ciManagement>

  <properties>
    <seed>589</seed>
    <clinicianSeed>1652609873669</clinicianSeed>
    <referenceTime>20240101</referenceTime>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.6.1</version>
        <executions>
          <execution>
            <id>get-synthea-jar</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.mitre.synthea</groupId>
                  <artifactId>synthea</artifactId>
                  <version>3.2.0</version>
                  <type>jar</type>
                  <classifier>all</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>${project.build.directory}/synthea</outputDirectory>
                  <destFileName>synthea.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.mitre.synthea</groupId>
            <artifactId>synthea</artifactId>
            <version>3.2.0</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-bulk</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-cp</argument>
                <argument>${project.build.directory}/synthea/synthea.jar</argument>
                <argument>App</argument>
                <argument>-s</argument>
                <argument>${seed}</argument>
                <argument>-cs</argument>
                <argument>${clinicianSeed}</argument>
                <argument>-r</argument>
                <argument>${referenceTime}</argument>
                <argument>-c</argument>
                <argument>src/main/resources/synthea.properties</argument>
                <argument>-d</argument>
                <argument>src/main/resources/modules</argument>
                <argument>--exporter.baseDirectory</argument>
                <argument>target/output/bulk</argument>
                <argument>--exporter.fhir.bulk_data</argument>
                <argument>true</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>generate-bundles</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>java</executable>
              <arguments>
                <argument>-cp</argument>
                <argument>${project.build.directory}/synthea/synthea.jar</argument>
                <argument>App</argument>
                <argument>-s</argument>
                <argument>${seed}</argument>
                <argument>-cs</argument>
                <argument>${clinicianSeed}</argument>
                <argument>-r</argument>
                <argument>${referenceTime}</argument>
                <argument>-c</argument>
                <argument>src/main/resources/synthea.properties</argument>
                <argument>-d</argument>
                <argument>src/main/resources/modules</argument>
                <argument>--exporter.baseDirectory</argument>
                <argument>target/output/bundles</argument>
                <argument>--exporter.fhir.bulk_data</argument>
                <argument>false</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.4.1</version>
        <configuration>
          <classesDirectory>${project.build.directory}/output</classesDirectory>
          <includes>
            <include>bulk/fhir/*.ndjson</include>
            <include>bulk/metadata/*.json</include>
            <include>bundles/fhir/*.json</include>
            <include>bundles/metadata/*.json</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.2.4</version>
          <executions>
            <execution>
              <id>sign</id>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <keyname>pathling@csiro.au</keyname>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.8.0</version>
          <extensions>true</extensions>
          <configuration>
            <publishingServerId>central</publishingServerId>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.sun.jersey</groupId>
              <artifactId>jersey-core</artifactId>
              <version>1.19.4</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>mavenRelease</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <configuration>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>snapshots</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>mavenPreRelease</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <configuration>
              <autoPublish>false</autoPublish>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
              <skip>releases</skip>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
