<?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>

    <artifactId>mara-examples</artifactId>
    <packaging>jar</packaging>
    <name>${project.groupId}:${project.artifactId}</name>
	<description>Mara - Java Annotations Framework for MapReduce on Hadoop</description>
	<url>https://github.com/conversant/mara</url>

	<parent>
		<groupId>com.conversantmedia</groupId>
		<artifactId>mara-parent</artifactId>
		<version>0.9.6</version>
	</parent>

	<properties>
		<main.class>com.conversantmedia.mapreduce.tool.RunJob</main.class>
	</properties>

    <dependencies>
    	<dependency>
			<groupId>com.conversantmedia</groupId>
			<artifactId>mara-core</artifactId>
			<type>jar</type>
			<version>${project.version}</version>
		</dependency>

   		<!-- Hadoop Dependencies -->
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-common</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-mapreduce-client-core</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.hadoop</groupId>
			<artifactId>hadoop-yarn-api</artifactId>
			<scope>provided</scope>
		</dependency>
		
    	<!-- Test Deps -->
    	<dependency>
			<groupId>com.conversantmedia</groupId>
			<artifactId>mara-test</artifactId>
			<scope>test</scope>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>org.apache.mrunit</groupId>
			<artifactId>mrunit</artifactId>
			<classifier>hadoop2</classifier>
			<scope>test</scope>
		</dependency>
		
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-all</artifactId>
			<scope>test</scope>
		</dependency>

    </dependencies>

    <build>
		<plugins>
 			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals><goal>add-source</goal></goals>
						<configuration>
							<sources>
								<source>src/main/avro</source>
								<source>target/generated-sources/avro</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.avro</groupId>
				<artifactId>avro-maven-plugin</artifactId>
				<executions>
						<execution>
							<id>schemas</id>
							<phase>generate-sources</phase>
							<goals>
								<goal>schema</goal>
							</goals>
						</execution>
				</executions>
			</plugin>
		
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<configuration>
					<descriptors>
						<descriptor>assembly/hadoop-job.xml</descriptor>
					</descriptors>
					<archive>
						<manifest>
							<mainClass>${main.class}</mainClass>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
        </plugins>
    </build>
 
</project>
