<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>
	<groupId>com.redislabs</groupId>
	<artifactId>spark-redis_2.11</artifactId>
	<version>2.4.2</version>
	<name>Spark-Redis</name>
	<description>A Spark library for Redis</description>
	<url>http://github.com/RedisLabs/spark-redis</url>

	<organization>
		<name>RedisLabs</name>
		<url>www.redislabs.com</url>
	</organization>
	<ciManagement>
		<system>CircleCI</system>
		<url>https://circleci.com/gh/RedisLabs/spark-redis</url>
	</ciManagement>
	<issueManagement>
		<url>https://github.com/RedisLabs/spark-redis/issues</url>
		<system>Github</system>
	</issueManagement>
	<scm>
		<url>https://github.com/RedisLabs/spark-redis</url>
		<connection>scm:git:git://github.com/RedisLabs/spark-redis.git</connection>
		<developerConnection>scm:git:git@github.com:RedisLabs/spark-redis.git</developerConnection>
	</scm>
	<developers>
		<developer>
			<name>Sun He</name>
			<organization>Redis Labs, Inc.</organization>
		</developer>
		<developer>
			<name>Shay Nativ</name>
			<organization>Redis Labs, Inc.</organization>
		</developer>
	</developers>
	<licenses>
		<license>
			<name>BSD 3 Clause</name>
			<url>https://opensource.org/licenses/BSD-3-Clause</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<scala.major.version>2.11</scala.major.version>
		<scala.complete.version>${scala.major.version}.12</scala.complete.version>
		<jedis.version>3.2.0</jedis.version>
		<spark.version>2.4.1</spark.version>
		<plugins.scalatest.version>1.0</plugins.scalatest.version>
	</properties>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
		    <id>ossrh</id>
    		<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
  		</repository>
	</distributionManagement>

	<build>
		<plugins>
			<plugin>
				<groupId>net.alchim31.maven</groupId>
				<artifactId>scala-maven-plugin</artifactId>
				<version>3.2.2</version>
				<configuration>
					<scalaVersion>${scala.complete.version}</scalaVersion>
					<javacArgs>
						<javacArg>-source</javacArg>
						<javacArg>${java.version}</javacArg>
						<javacArg>-target</javacArg>
						<javacArg>${java.version}</javacArg>
					</javacArgs>
				</configuration>
				<executions>
					<execution>
						<id>scala-compile</id>
						<phase>process-resources</phase>
						<goals>
							<goal>compile</goal>
						</goals>
					</execution>
					<execution>
						<id>scala-test-compile</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
					</execution>
					<execution>
						<id>attach-javadocs</id>
							<goals>
								<goal>doc-jar</goal>
							</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.scalastyle</groupId>
				<artifactId>scalastyle-maven-plugin</artifactId>
				<version>0.7.0</version>
				<configuration>
					<verbose>false</verbose>
					<failOnWarning>false</failOnWarning>
					<failOnViolation>true</failOnViolation>
					<includeTestSourceDirectory>true</includeTestSourceDirectory>
					<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
					<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
					<configLocation>${basedir}/scalastyle-config.xml</configLocation>
					<outputFile>${project.basedir}/scalastyle-output.xml</outputFile>
					<outputEncoding>UTF-8</outputEncoding>
				</configuration>
				<executions>
					<execution>
						<phase>compile</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<skipIfEmpty>true</skipIfEmpty>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.5.4</version>
				<configuration>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.10</version>
				<executions>
					<execution>
						<id>add-scala-sources</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/main/scala</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-scala-test-sources</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/test/scala</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.4</version>
				<inherited>false</inherited>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.doxia</groupId>
						<artifactId>doxia-module-markdown</artifactId>
						<version>1.6</version>
					</dependency>
					<dependency>
						<groupId>lt.velykis.maven.skins</groupId>
						<artifactId>reflow-velocity-tools</artifactId>
						<version>1.1.1</version>
					</dependency>
					<!-- Reflow skin requires Velocity >= 1.7  -->
					<dependency>
						<groupId>org.apache.velocity</groupId>
						<artifactId>velocity</artifactId>
						<version>1.7</version>
					</dependency>
				</dependencies>
			</plugin>
			<!-- disable surefire -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.18.1</version>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
			<!-- enable scalatest -->
			<plugin>
				<groupId>org.scalatest</groupId>
				<artifactId>scalatest-maven-plugin</artifactId>
				<version>${plugins.scalatest.version}</version>
				<configuration>
					<reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
					<junitxml>.</junitxml>
					<filereports>WDF TestSuite.txt</filereports>
					<argLine>-XX:MaxPermSize=256m -Xmx2g</argLine>
					<tagsToExclude>com.redislabs.provider.redis.util.BenchmarkTest</tagsToExclude>
				</configuration>
				<executions>
					<execution>
						<id>test</id>
						<goals>
							<goal>test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
		</plugins>
	</build>
	<dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>${jedis.version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${scala.complete.version}</version>
        </dependency>
		<dependency>
			<groupId>org.scala-lang</groupId>
			<artifactId>scalap</artifactId>
			<version>${scala.complete.version}</version>
		</dependency>
		<dependency>
			<groupId>org.scala-lang</groupId>
			<artifactId>scala-compiler</artifactId>
			<version>${scala.complete.version}</version>
		</dependency>
		<dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_${scala.major.version}</artifactId>
            <version>${spark.version}</version>
			<scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming_${scala.major.version}</artifactId>
            <version>${spark.version}</version>
			<scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-sql_${scala.major.version}</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>
		<dependency>
			<groupId>org.scalatest</groupId>
			<artifactId>scalatest_${scala.major.version}</artifactId>
			<version>3.0.8</version>
			<scope>test</scope>
		</dependency>
    </dependencies>
    <profiles>
		<profile>
			<id>benchmark</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.scalatest</groupId>
						<artifactId>scalatest-maven-plugin</artifactId>
						<version>${plugins.scalatest.version}</version>
						<configuration combine.self="override">
							<tagsToInclude>com.redislabs.provider.redis.util.BenchmarkTest</tagsToInclude>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!--Include sources and docs-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!--Sign the components - this is required by maven central for releases-->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
