<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>
		<groupId>com.impetus.fabric</groupId>
		<artifactId>fabric-jdbc-connector</artifactId>
		<version>1.1.0</version>
	</parent>
	<artifactId>fabric-spark-connector</artifactId>
	<name>Fabric Spark Connector</name>
	<properties>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<encoding>UTF-8</encoding>
		<scala.version>2.11.5</scala.version>
		<scala.compat.version>2.11</scala.compat.version>
		<skip.integration.tests>true</skip.integration.tests>
		<blkchn.driver.version>1.1.0</blkchn.driver.version>
	</properties>

	<profiles>
		<profile>
			<id>integration-test</id>
			<properties>
				<skip.integration.tests>false</skip.integration.tests>
			</properties>
		</profile>
	</profiles>

	<dependencies>

		<!-- Test -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.specs2</groupId>
			<artifactId>specs2-core_${scala.compat.version}</artifactId>
			<version>2.4.16</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.scalatest</groupId>
			<artifactId>scalatest_${scala.compat.version}</artifactId>
			<version>2.2.4</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.spark</groupId>
			<artifactId>spark-sql_2.11</artifactId>
			<version>2.0.2</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.impetus.fabric</groupId>
			<artifactId>fabric-jdbc-driver-shaded</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.impetus.blkchn</groupId>
			<artifactId>blkchn-spark-connector</artifactId>
			<version>${blkchn.driver.version}</version>
		</dependency>
	</dependencies>

	<build>
		<sourceDirectory>src/main/scala</sourceDirectory>
		<plugins>
			<plugin>
				<groupId>net.alchim31.maven</groupId>
				<artifactId>scala-maven-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<goal>testCompile</goal>
							<goal>add-source</goal>
						</goals>
					</execution>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>doc-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18.1</version>
				<configuration>
					<useFile>false</useFile>
					<disableXmlReport>true</disableXmlReport>
					<includes>
						<include>**/*Test.*</include>
						<include>**/*Suite.*</include>
					</includes>
					<!-- disable surefire -->
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.3</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/*.SF</exclude>
								<exclude>META-INF/*.DSA</exclude>
								<exclude>META-INF/*.RSA</exclude>
							</excludes>
						</filter>
					</filters>
					<transformers>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
							<resource>reference.conf</resource>
						</transformer>
						<transformer
							implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
					</transformers>
					<finalName>${project.artifactId}-assembly-${project.version}</finalName>
				</configuration>
			</plugin>
			 <!-- enable scalatest -->
			 <plugin>
				<groupId>org.scalatest</groupId>
				<artifactId>scalatest-maven-plugin</artifactId>
				<version>1.0</version>
				<configuration>
					<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
					<junitxml>.</junitxml>
					<filereports>TestSuite.txt</filereports>
				</configuration>
				<executions>
					<execution>
						<id>integration-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<tagsToInclude>com.impetus.test.catagory.IntTest,com.impetus.test.catagory.UnitTest</tagsToInclude>
							<skipTests>${skip.integration.tests}</skipTests>
						</configuration>
					</execution>
					<execution>
						<id>test</id>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<tagsToInclude>com.impetus.test.catagory.UnitTest</tagsToInclude>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
