<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>
        <artifactId>matchbox</artifactId>
        <groupId>health.matchbox</groupId>
        <version>3.2.2</version>
    </parent>

    <artifactId>matchbox-engine</artifactId>
    <name>matchbox-engine</name>
    <description>An open-source implementation to support testing and implementation of FHIR based solutions and map or
        capture health data into HL7® FHIR®
    </description>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.r4</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.r5</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.convertors</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.validation</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.utilities</artifactId>
        </dependency>

        <!-- This dependency is used for the "FHIR Tester" web app overlay <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-testpage-overlay</artifactId> <version>${hapi.fhir.version}</version> <type>war</type> <scope>provided</scope> </dependency>
                <dependency> <groupId>ca.uhn.hapi.fhir</groupId> <artifactId>hapi-fhir-testpage-overlay</artifactId> <version>${hapi.fhir.version}</version> <classifier>classes</classifier> </dependency> -->

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-to-slf4j</artifactId>
        </dependency>

        <!-- If you are using HAPI narrative generation, you will need to include Thymeleaf as well. Otherwise the following can be omitted. <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf</artifactId> </dependency> -->

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- dependencies for test -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>matchbox-engine</finalName>
        <plugins>
            <!-- The following is not required for the application to build, but allows you to test it by issuing "mvn package jetty:run -Dspring.batch.job.enabled=false" from the command line. -->
            <!-- <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>${jetty_version}</version> <configuration> <webApp> <contextPath>/hapi-fhir-jpaserver</contextPath> <allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
                      </webApp> </configuration> </plugin> -->

            <!-- Tell Maven which Java source version you want to use -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <release>11</release>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

            <!-- This is to run the integration tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.basepom.maven</groupId>
                <artifactId>duplicate-finder-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <inherited>true</inherited>
                    </execution>
                </executions>
                <configuration>
                    <failBuildInCaseOfConflict>false</failBuildInCaseOfConflict>
                    <checkTestClasspath>false</checkTestClasspath>
                    <!-- <printEqualFiles>false</printEqualFiles> <failBuildInCaseOfDifferentContentConflict>true</failBuildInCaseOfDifferentContentConflict> <failBuildInCaseOfEqualContentConflict>true</failBuildInCaseOfEqualContentConflict> <failBuildInCaseOfConflict>true</failBuildInCaseOfConflict>
                                  <checkCompileClasspath>true</checkCompileClasspath> <checkRuntimeClasspath>false</checkRuntimeClasspath> <skip>false</skip> <quiet>false</quiet> <preferLocal>true</preferLocal> <useResultFile>true</useResultFile> <resultFileMinClasspathCount>2</resultFileMinClasspathCount>
                                  <resultFile>${project.build.directory}/duplicate-finder-result.xml</resultFile> -->
                    <!-- <ignoredDependencies> <dependency> <groupId>javax.el</groupId> <artifactId>javax.el-api</artifactId> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>javax.mail-api</artifactId> </dependency> <dependency> <groupId>javax.activation</groupId>
                                  <artifactId>javax.activation-api</artifactId> </dependency> <dependency> <groupId>com.helger</groupId> <artifactId>ph-schematron</artifactId> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency>
                                  <dependency> <groupId>org.jscience</groupId> <artifactId>jscience</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jcl</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jcl</artifactId>
                                  </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>annotations</artifactId> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId> </dependency> <dependency> <groupId>org.apache.derby</groupId>
                                  <artifactId>derbynet</artifactId> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId> </dependency> <dependency> <groupId>org.checkerframework</groupId> <artifactId>checker-compat-qual</artifactId> </dependency>
                                  </ignoredDependencies> -->
                    <ignoredResourcePatterns>
                        <ignoredResourcePattern>.*\.txt$</ignoredResourcePattern>
                        <ignoredResourcePattern>.*\.html$</ignoredResourcePattern>
                        <ignoredResourcePattern>config/favicon.ico</ignoredResourcePattern>
                    </ignoredResourcePatterns>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <inherited>true</inherited>
                <executions>
                    <execution>
                        <id>standard</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>downstream</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>create-metadata</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/generated-sources/properties</outputDirectory>
                            <outputName>matchbox-build.properties</outputName>
                            <revisionPropertyName>matchbox.buildnumber</revisionPropertyName>
                            <timestampPropertyName>matchbox.timestamp</timestampPropertyName>
                            <timestampFormat>yyyy-MM-dd'T'HH:mm:ss.SXXX</timestampFormat>
                            <versionPropertyName>matchbox.version</versionPropertyName>
                            <revisionOnScmFailure>UNKNOWN</revisionOnScmFailure>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
            <resource>
                <directory>${project.build.directory}/generated-sources/properties</directory>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>
</project>
