<?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>
    <packaging>pom</packaging>
    <artifactId>heat-core</artifactId>
    <version>4.0.2</version>

    <parent>
        <groupId>com.hotels</groupId>
        <artifactId>hotels-oss-parent</artifactId>
        <version>2.3.3</version>
    </parent>

    <scm>
        <connection>scm:git:git@github.com:HotelsDotCom/heat.git</connection>
        <developerConnection>scm:git:git@github.com:HotelsDotCom/heat.git</developerConnection>
        <url>https://github.com/HotelsDotCom/heat</url>
        <tag>heat-core-4.0.2</tag>
    </scm>

    <modules>
        <module>heat-module-support</module>
        <module>heat-core-utils</module>
        <module>heat-internal-modules</module>
        <module>heat-bundle</module>
        <module>heat-test-module</module>
    </modules>

    <inceptionYear>2015</inceptionYear>

    <dependencies>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <version>3.1.1</version>
        </dependency>
        <!-- Unit Testing -->
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>1.6.3</version>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-testng</artifactId>
            <version>1.6.3</version>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>1.5.6</version>
        </dependency>

    </dependencies>
    <properties>

        <jdk.version>1.8</jdk.version>

        <!-- Maven PMD Plugin -->
        <maven-pmd-plugin.version>3.1</maven-pmd-plugin.version>
        <pmd.config.location>rules/pmd_rules.xml</pmd.config.location>
        <pmd.failOnViolation>false</pmd.failOnViolation>
        <pmd.skip>false</pmd.skip>
        <pmd.skipEmptyReport>true</pmd.skipEmptyReport>

        <!--site markdown-->
        <plugin.maven.site.version>3.7.1</plugin.maven.site.version>

        <!--jacoco configuration-->
        <jacoco.classRatio>0</jacoco.classRatio>
        <jacoco.instructionRatio>0</jacoco.instructionRatio>
        <jacoco.methodRatio>0</jacoco.methodRatio>
        <jacoco.branchRatio>0</jacoco.branchRatio>
        <jacoco.complexityRatio>0</jacoco.complexityRatio>
        <jacoco.lineRatio>0</jacoco.lineRatio>

        <maven.site.plugin.version>3.8.0</maven.site.plugin.version>
        <hotels.oss.plugin.config.version>1.2.1</hotels.oss.plugin.config.version>

    </properties>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${plugin.maven.site.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>1.6</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Generate javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
            <!-- jacoco coverage plugin -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.2</version>
                <configuration>
                    <excludes>
                        <exclude>com/hotels/heat/core/listeners/**</exclude>
                        <exclude>com/hotels/heat/core/singleServices/TestRunner.class</exclude>
                        <exclude>com/hotels/heat/core/compareServices/TestCompareRunner.class</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>post-integration-test</phase>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.complexityRatio}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>CLASS</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.classRatio}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>METHOD</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.methodRatio}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.branchRatio}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>LINE</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.lineRatio}</minimum>
                                        </limit>
                                        <limit>
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>${jacoco.instructionRatio}</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <!-- This should match the id you have your settings.xml-->
                    <serverId>sonatype-nexus-staging</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <version>${cobertura.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
