<?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.mule.extensions</groupId>
        <artifactId>mule-core-modules-parent</artifactId>
        <version>1.0.0-BETA.3</version>
    </parent>

    <groupId>com.mulesoft.munit</groupId>
    <artifactId>munit-tools</artifactId>
    <version>2.0.0-BETA</version>
    <packaging>mule-extension</packaging>
    <name>MUnit Tools</name>

    <properties>
        <commons.lang3.version>3.6</commons.lang3.version>

        <!-- Plugin Versions -->
        <jacoco.version>0.7.8</jacoco.version>
        <find.bugs.version>3.0.4</find.bugs.version>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <javaFormatter.plugin.version>1.8.0</javaFormatter.plugin.version>

        <mule.service.scheduler>1.0.0-BETA.3</mule.service.scheduler>
        <mule.service.weave.version>2.0.0-BETA.2</mule.service.weave.version>
        <mule.module.service.version>4.0.0-BETA.3</mule.module.service.version>

        <formatterConfigPath>../../formatter.xml</formatterConfigPath>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-assert</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>munit-mock</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons.lang3.version}</version>
        </dependency>

        <!--TODO Workaround for MULE-11650-->
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-core</artifactId>
            <version>${mule.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>asm</groupId>
                    <artifactId>asm</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!--TODO MULE-10837/MU-942-->
        <dependency>
            <groupId>org.mule.runtime</groupId>
            <artifactId>mule-module-service</artifactId>
            <version>${mule.module.service.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-scheduler</artifactId>
            <version>${mule.service.scheduler}</version>
            <classifier>mule-service</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.services</groupId>
            <artifactId>mule-service-weave</artifactId>
            <version>${mule.service.weave.version}</version>
            <classifier>mule-service</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <configuration>
                    <haltOnFailure>true</haltOnFailure>
                    <rules>
                        <rule>
                            <element>BUNDLE</element>
                            <!--<limits>-->
                            <!--<limit>-->
                            <!--<counter>BRANCH</counter>-->
                            <!--<value>COVEREDRATIO</value>-->
                            <!--&lt;!&ndash;<minimum>0.43</minimum>&ndash;&gt;-->
                            <!--<minimum>0.42</minimum>-->
                            <!--</limit>-->
                            <!--<limit>-->
                            <!--<counter>INSTRUCTION</counter>-->
                            <!--<value>COVEREDRATIO</value>-->
                            <!--<minimum>0.43</minimum>-->
                            <!--</limit>-->
                            <!--<limit>-->
                            <!--<counter>LINE</counter>-->
                            <!--<value>COVEREDRATIO</value>-->
                            <!--&lt;!&ndash;<minimum>0.55</minimum>&ndash;&gt;-->
                            <!--<minimum>0.53</minimum>-->
                            <!--</limit>-->
                            <!--</limits>-->
                            <!--Previous coverage limits-->
                            <!--<lineRate>71</lineRate>-->
                            <!--<branchRate>60</branchRate>-->
                            <!--<packageLineRate>78</packageLineRate>-->
                            <!--<packageBranchRate>70</packageBranchRate>-->
                            <!--<totalLineRate>86</totalLineRate>-->
                            <!--<totalBranchRate>75</totalBranchRate>-->
                        </rule>
                    </rules>
                </configuration>
                <executions>
                    <execution>
                        <id>default-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${find.bugs.version}</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle.plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

  <scm>
    <tag>munit-2.0.0-BETA</tag>
  </scm>
</project>
