<?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">
    <parent>
        <artifactId>bahmni-commons</artifactId>
        <groupId>org.bahmni.module</groupId>
        <version>1.2.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>bahmni-commons-api</artifactId>
    <name>Bahmni commons Api</name>
    <packaging>jar</packaging>

    <properties>
        <MODULE_ID>bahmnicommons</MODULE_ID>
        <MODULE_NAME>${project.name}</MODULE_NAME>
        <MODULE_VERSION>${project.version}</MODULE_VERSION>
        <MODULE_PACKAGE>${project.groupId}.${MODULE_ID}</MODULE_PACKAGE>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.openmrs.api</groupId>
            <artifactId>openmrs-api</artifactId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.openmrs.web</groupId>
            <artifactId>openmrs-web</artifactId>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>webservices.rest-omod</artifactId>
        </dependency>
        <dependency>
            <groupId>org.openmrs.module</groupId>
            <artifactId>webservices.rest-omod-common</artifactId>
        </dependency>

    <!--Test Dependencies-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockitoVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.web</groupId>
            <artifactId>openmrs-web</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.test</groupId>
            <artifactId>openmrs-test</artifactId>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.openmrs.api</groupId>
            <artifactId>openmrs-api</artifactId>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>1.19.0</version>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>

        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacocoVersion}</version>
                <executions>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>report</goal>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/jacoco-reports</outputDirectory>
                            <includes>
                                <include>**/*</include>
                            </includes>
                            <excludes>
                                <exclude>**/*Activator.class</exclude>
                            </excludes>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.27</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.20</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
