<?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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>ipp-v3-java-devkit-pom</artifactId>
        <groupId>com.intuit.quickbooks-online</groupId>
        <version>2.9.0</version>
    </parent>

	<artifactId>ipp-v3-java-devkit</artifactId>
	<version>2.9.0</version>
	<packaging>jar</packaging>
	<name>IPP V3 Java Devkit - Development Project</name>
	<description>IPP Java V3 DevKit Project - Core</description>

	<properties>
		<sonar.langauge>java</sonar.langauge>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
	</properties>

	<dependencies>
			<dependency>
			<groupId>com.intuit.quickbooks-online</groupId>
			<artifactId>ipp-v3-java-data</artifactId>
			<version>2.9.0</version>
		</dependency>
		        		<dependency>
	<groupId>javax.xml.bind</groupId>
	<artifactId>jaxb-api</artifactId>
	<version>2.2.6</version>
</dependency>
		<dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.9.10</version>
  <scope>test</scope>
</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<directory>${basedir}/src/main/resources</directory>
			</resource>
		</resources>
		<!-- <finalName>ipp-v3-java-devkit</finalName> -->
		<plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
			<!-- build jar with dependencies -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<finalName>${project.artifactId}-${project.version}</finalName>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
				<executions>
				    <execution>
        				<id>dist-assembly</id>
        				<phase>package</phase>
        				<goals>
            					<goal>single</goal>
        				</goals>
    				    </execution>
				</executions>
			</plugin>
			
			<!-- Surefire plugin before 2.9 version is buggy -->
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.12</version>
				<configuration>
					<suiteXmlFiles>
						<suiteXmlFile>testng.xml</suiteXmlFile>
					</suiteXmlFiles>
				</configuration>
			</plugin>
			
			<!-- build javadocs jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			
			
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<shadedArtifactAttached>true</shadedArtifactAttached>
							<shadedArtifactId>shaded-dependencies</shadedArtifactId>
							<relocations>
								<relocation>
									<pattern>net.sf.cglib</pattern>
									<shadedPattern>com.intuit.ipp.query.cglib</shadedPattern>
								</relocation>
								<relocation>
									<pattern>org.apache.http</pattern>
									<shadedPattern>com.intuit.apache.http</shadedPattern>
								</relocation>
							</relocations>
						</configuration>
					</execution>
				</executions>
			</plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <!-- <version>0.7.6-SNAPSHOT</version> -->
                <version>0.7.6.201602180812</version>
                <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>
                        <configuration>
                            <rules>
                                <rule implementation="org.jacoco.maven.RuleConfiguration">
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit implementation="org.jacoco.report.check.Limit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.30</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
            <id>default-tests</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<test.suite>testng.xml</test.suite>
			</properties>
		</profile>
	</profiles>
</project>
