<?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</artifactId>
    <version>1.5.1</version>

    <packaging>jar</packaging>

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

    <dependencies>
        <dependency>
            <groupId>org.jvnet.jaxb2_commons</groupId>
            <artifactId>jaxb2-basics</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>org.eclipse.persistence.moxy</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
        </dependency>
        <dependency>
            <groupId>org.fhir</groupId>
            <artifactId>ucum</artifactId>
        </dependency>
        <!-- This depedency adds to the javax.xml.namespace package which is not valid in Java 9+-->
        <dependency>
            <groupId>xpp3</groupId>
            <artifactId>xpp3</artifactId>
        </dependency>
        <dependency>
            <groupId>xpp3</groupId>
            <artifactId>xpp3_xpath</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-jaxb-annotations</artifactId>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <!-- TODO: Figure out what java doc does not respect source file exclusions when linting-->
                    <!-- <excludePackageNames>org.cqframework.cql.elm.execution</excludePackageNames>
                    <sourceFileExcludes>
                        <exclude>**/org/cqframework/cql/elm/execution/*.java</exclude>
                    </sourceFileExcludes> -->
                    <additionalOptions>
                        <additionalOption>-Xdoclint:none</additionalOption>
                    </additionalOptions>
                </configuration>
            </plugin>
            <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>
                    <schemaDirectory>${project.basedir}/src/main/resources/cql-lm/schema/elm</schemaDirectory>
                    <schemaIncludes>
                        <include>library.xsd</include>
                    </schemaIncludes>
                    <args>
                        <arg>-Xfluent-api</arg>
                        <arg>-Xequals</arg>
                        <arg>-XhashCode</arg>
                        <arg>-XtoString</arg>
                        <arg>-npa</arg>
                        <arg>-XautoInheritance</arg>
                        <arg>-XautoInheritance-xmlTypesExtend=org.opencds.cqf.cql.engine.elm.execution.Executable</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.cqframework.cql.elm.execution</generatePackage>
                    <readOnly>false</readOnly>
                    <markGenerated>false</markGenerated>
                    <disableXmlSecurity>true</disableXmlSecurity>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>org.opencds.cqf.cql.engine.**</include>
                    </includes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-testng</artifactId>
                        <version>2.21.0</version>
                    </dependency>
                </dependencies>
            </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/cqframework/**</exclude>
                    </excludes>
                    <rules>
                        <rule>
                            <element>BUNDLE</element>
                            <limits>
                                <limit>
                                    <counter>LINE</counter>
                                    <value>COVEREDRATIO</value>
                                    <minimum>0.70</minimum>
                                </limit>
                            </limits>
                        </rule>
                    </rules>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
