<?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>org.opencds.cqf.cql</groupId>
        <artifactId>engine.shared</artifactId>
        <version>1.5.1</version>
    </parent>

    <groupId>org.opencds.cqf.cql</groupId>
    <artifactId>engine.fhir</artifactId>
    <version>1.5.1</version>
    <packaging>jar</packaging>

    <name>engine.fhir</name>
    <description>CQL Engine FHIR providers</description>
    <url>https://github.com/DBCG/cql_engine/tree/master/engine.fhir</url>

    <dependencies>
        <dependency>
            <groupId>org.opencds.cqf.cql</groupId>
            <artifactId>engine</artifactId>
            <version>1.5.1</version>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-client</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-dstu2</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-dstu3</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-r4</artifactId>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-r5</artifactId>
        </dependency>
        <dependency>
            <groupId>xpp3</groupId>
            <artifactId>xpp3</artifactId>
        </dependency>
        <dependency>
            <groupId>xpp3</groupId>
            <artifactId>xpp3_xpath</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <addTestCompileSourceRoot>true</addTestCompileSourceRoot>
                    <generateDirectory>target/generated-test-sources/xjc</generateDirectory>
                    <schemaDirectory>${project.basedir}/src/test/resources/org/hl7/fhirpath/testSchema</schemaDirectory>
                    <schemaIncludes>
                        <include>testSchema.xsd</include>
                    </schemaIncludes>
                    <args>
                        <arg>-Xfluent-api</arg>
                        <arg>-Xequals</arg>
                        <arg>-XhashCode</arg>
                        <arg>-XtoString</arg>
                        <arg>-npa</arg>
                        <arg>-Xannotate</arg>
                    </args>
                    <plugins>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-fluent-api</artifactId>
                            <version>3.0</version>
                        </plugin>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics</artifactId>
                            <version>0.12.0</version>
                        </plugin>
                        <plugin>
                            <groupId>org.jvnet.jaxb2_commons</groupId>
                            <artifactId>jaxb2-basics-annotate</artifactId>
                            <version>1.1.0</version>
                        </plugin>
                    </plugins>
                    <generatePackage>org.hl7.fhirpath.tests</generatePackage>
                    <readOnly>false</readOnly>
                    <markGenerated>false</markGenerated>
                    <disableXmlSecurity>true</disableXmlSecurity>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.21.0</version>
                <configuration>
                    <includes>
                        <include>org.hl7.fhirpath.**</include>
                        <include>org.opencds.cqf.cql.engine.fhir.**</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <excludePackageNames>org.hl7.fhirpath.tests</excludePackageNames>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>

                <executions>
                    <execution>
                        <id>jacoco-check</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- generated code -->
                    <excludes>
                        <exclude>**/org/hl7/fhirpath/tests/**</exclude>
                    </excludes>
                    <rules>
                        <rule>
                            <element>BUNDLE</element>
                            <limits>
                                <limit>
                                    <counter>LINE</counter>
                                    <value>COVEREDRATIO</value>
                                    <minimum>0.50</minimum>
                                </limit>
                            </limits>
                        </rule>
                    </rules>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
