<?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>
		<groupId>org.boundbox</groupId>
		<artifactId>boundbox-parent</artifactId>
		<version>1.1.1</version>
	</parent>

	<artifactId>boundbox-library</artifactId>
	<packaging>jar</packaging>

	<properties>
		<java.version>1.6</java.version>
		<maven-compiler-plugin.version>2.5.1</maven-compiler-plugin.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<version>0.12.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.1</version>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-io</artifactId>
			<version>1.3.2</version>
		</dependency>
		<dependency>
			<groupId>com.squareup</groupId>
			<artifactId>javawriter</artifactId>
			<version>2.2.0</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.11</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.easymock</groupId>
			<artifactId>easymock</artifactId>
			<version>3.2</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<sourceDirectory>src/main/java</sourceDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven-compiler-plugin.version}</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
					<annotationProcessors>
						<annotationProcessor>lombok.core.AnnotationProcessor</annotationProcessor>
					</annotationProcessors>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>coveralls</id>
			<activation>
				<property>
					<name>skipTests</name>
					<value>false</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!-- CODE COVERAGE FOR UNIT-TESTS http://www.javacodegeeks.com/2013/08/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin.html -->
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>0.6.3.201306030806</version>
						<configuration>
							<excludes>
								<exclude>**/*Exception.class</exclude>
							</excludes>
						</configuration>
						<executions>
							<!-- Prepares the property pointing to the JaCoCo runtime agent which 
								is passed as VM argument when Maven the Surefire plugin is executed. -->
							<execution>
								<id>pre-unit-test</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<!-- Sets the path to the file which contains the execution data. -->
									<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
								</configuration>
							</execution>
							<!-- Ensures that the code coverage report for unit tests is created 
								after unit tests have been run. -->
							<execution>
								<id>post-unit-test</id>
								<phase>test</phase>
								<goals>
									<goal>report</goal>
								</goals>
								<configuration>
									<!-- Sets the path to the file which contains the execution data. -->
									<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
									<!-- Sets the output directory for the code coverage report. -->
									<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.eluder.coveralls</groupId>
						<artifactId>coveralls-maven-plugin</artifactId>
						<version>2.0.1</version>
						<executions>
							<execution>
								<id>post-unit-test</id>
								<phase>test</phase>
								<goals>
									<goal>jacoco</goal>
								</goals>
								<configuration>
									<coverageFile>${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml</coverageFile>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
