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

	<modelVersion>4.0.0</modelVersion>

	<artifactId>spring-data-rest-webmvc</artifactId>

	<name>Spring Data REST - WebMVC</name>
	<description>Spring Data REST - WebMVC</description>

	<parent>
		<groupId>org.springframework.data</groupId>
		<artifactId>spring-data-rest-parent</artifactId>
		<version>2.4.4.RELEASE</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<properties>
		<jsonpath>0.9.1</jsonpath>
		<cassandra.version>2.0.9</cassandra.version>
		<cassandraunit.version>2.0.2.1</cassandraunit.version>
		<spring-security.version>4.0.1.RELEASE</spring-security.version>
		<groovy.version>2.4.4</groovy.version>
	</properties>

	<dependencies>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>spring-data-rest-core</artifactId>
			<version>${project.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
		</dependency>

		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.0.1</version>
			<scope>provided</scope>
		</dependency>

		<!-- Jackson -->

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson}</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>${jackson}</version>
		</dependency>

		<!-- Jackson Hibernate -->

		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-hibernate4</artifactId>
			<version>${jackson}</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>${hibernate.version}</version>
			<optional>true</optional>
		</dependency>

		<!-- Jackson JodaTime -->

		<dependency>
			<groupId>com.fasterxml.jackson.datatype</groupId>
			<artifactId>jackson-datatype-joda</artifactId>
			<version>${jackson}</version>
			<optional>true</optional>
		</dependency>

		<!-- JSON patch -->

		<dependency>
			<groupId>com.github.fge</groupId>
			<artifactId>json-patch</artifactId>
			<version>1.7</version>
		</dependency>

		<!-- Querydsl -->

		<dependency>
			<groupId>com.mysema.querydsl</groupId>
			<artifactId>querydsl-core</artifactId>
			<version>${querydsl}</version>
			<optional>true</optional>
		</dependency>

		<!-- Optional store specifics -->

		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-orm</artifactId>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>javax.persistence</artifactId>
			<version>2.0.0</version>
			<optional>true</optional>
		</dependency>

		<!-- Test dependencies -->

		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<version>${jsonpath}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-all</artifactId>
			<version>${groovy.version}</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<profiles>

		<profile>
			<id>unifying</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<dependencies>
				<!-- Neo4j VS. Solr -->
				<dependency>
					<groupId>commons-io</groupId>
					<artifactId>commons-io</artifactId>
					<version>2.3</version>
					<scope>test</scope>
				</dependency>
			</dependencies>

		</profile>

		<profile>
			<id>neo4j</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<dependencies>
				<dependency>
					<groupId>org.springframework.data</groupId>
					<artifactId>spring-data-neo4j</artifactId>
					<version>${springdata.neo4j}</version>
					<scope>test</scope>
				</dependency>
			</dependencies>

		</profile>

		<profile>
			<id>gemfire</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<dependencies>
				<dependency>
					<groupId>org.springframework.data</groupId>
					<artifactId>spring-data-gemfire</artifactId>
					<version>${springdata.gemfire}</version>
					<scope>test</scope>
				</dependency>
			</dependencies>
		</profile>

		<profile>
			<id>cassandra</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<dependencies>

				<dependency>
					<groupId>org.springframework.data</groupId>
					<artifactId>spring-data-cassandra</artifactId>
					<version>${springdata.cassandra}</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>org.apache.cassandra</groupId>
					<artifactId>cassandra-all</artifactId>
					<version>${cassandra.version}</version>
					<scope>test</scope>
					<exclusions>
						<exclusion>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-log4j12</artifactId>
						</exclusion>
					</exclusions>
				</dependency>

				<dependency>
					<groupId>org.cassandraunit</groupId>
					<artifactId>cassandra-unit-spring</artifactId>
					<version>${cassandraunit.version}</version>
					<scope>test</scope>
					<exclusions>
						<exclusion>
							<groupId>org.hamcrest</groupId>
							<artifactId>hamcrest-all</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.apache.cassandra</groupId>
							<artifactId>cassandra-all</artifactId>
						</exclusion>
						<exclusion>
							<groupId>com.datastax.cassandra</groupId>
							<artifactId>cassandra-driver-core</artifactId>
						</exclusion>
						<exclusion>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-log4j12</artifactId>
						</exclusion>
					</exclusions>
				</dependency>

				<dependency>
					<groupId>org.xerial.snappy</groupId>
					<artifactId>snappy-java</artifactId>
					<version>1.1.0.1</version>
					<scope>test</scope>
				</dependency>

				<!-- Declare Antlr locally to favor this one as Solr pulls in 3.5 which breaks Cassandra -->
				<dependency>
					<groupId>org.antlr</groupId>
					<artifactId>antlr-runtime</artifactId>
					<version>3.2</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>com.google.guava</groupId>
					<artifactId>guava</artifactId>
					<version>${guava}</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>com.googlecode.concurrentlinkedhashmap</groupId>
					<artifactId>concurrentlinkedhashmap-lru</artifactId>
					<version>1.3.1</version>
					<scope>test</scope>
				</dependency>

			</dependencies>
		</profile>

		<profile>
			<id>solr</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<dependencies>

				<dependency>
					<groupId>org.springframework.data</groupId>
					<artifactId>spring-data-solr</artifactId>
					<version>${springdata.solr}</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>org.apache.solr</groupId>
					<artifactId>solr-core</artifactId>
					<version>4.10.1</version>
					<scope>test</scope>
					<exclusions>
						<exclusion>
							<groupId>org.slf4j</groupId>
							<artifactId>slf4j-api</artifactId>
						</exclusion>
						<exclusion>
							<artifactId>jdk.tools</artifactId>
							<groupId>jdk.tools</groupId>
						</exclusion>
						<exclusion>
							<groupId>com.google</groupId>
							<artifactId>guava</artifactId>
						</exclusion>
					</exclusions>
				</dependency>

			</dependencies>

		</profile>

		<profile>

			<id>spring-security</id>

			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<dependencies>

				<dependency>
					<groupId>org.springframework.security</groupId>
					<artifactId>spring-security-core</artifactId>
					<version>${spring-security.version}</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>org.springframework.security</groupId>
					<artifactId>spring-security-config</artifactId>
					<version>${spring-security.version}</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>org.springframework.security</groupId>
					<artifactId>spring-security-web</artifactId>
					<version>${spring-security.version}</version>
					<scope>test</scope>
				</dependency>

				<dependency>
					<groupId>org.springframework.security</groupId>
					<artifactId>spring-security-test</artifactId>
					<version>${spring-security.version}</version>
					<scope>test</scope>
				</dependency>

			</dependencies>
		</profile>

	</profiles>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<executions>
					<execution>
						<id>default-test</id>
						<configuration>
							<excludes>
								<exclude>**/*</exclude>
							</excludes>
						</configuration>
					</execution>
					<execution>
						<id>base-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/*Test*.java</include>
							</includes>
							<!-- exclude store-specific tests from base-tests -->
							<excludes>
								<exclude>**/cassandra/*Test*.java</exclude>
								<exclude>**/gemfire/*Test*.java</exclude>
								<exclude>**/jpa/*Test*.java</exclude>
								<exclude>**/mongodb/*Test*.java</exclude>
								<exclude>**/neo4j/*Test*.java</exclude>
								<exclude>**/solr/*Test*.java</exclude>
							</excludes>
						</configuration>
					</execution>
					<execution>
						<id>cassandra-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/cassandra/*Test*.java</include>
							</includes>
						</configuration>
					</execution>
					<execution>
						<id>gemfire-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/gemfire/*Test*.java</include>
							</includes>
						</configuration>
					</execution>
					<execution>
						<id>jpa-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/jpa/*Test*.java</include>
							</includes>
						</configuration>
					</execution>
					<execution>
						<id>mongodb-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/mongodb/*Test*.java</include>
							</includes>
						</configuration>
					</execution>
					<execution>
						<id>neo4j-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/neo4j/*Test*.java</include>
							</includes>
						</configuration>
					</execution>
					<execution>
						<id>solr-tests</id>
						<goals>
							<goal>test</goal>
						</goals>
						<phase>test</phase>
						<configuration>
							<includes>
								<include>**/solr/*Test*.java</include>
							</includes>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>com.mysema.maven</groupId>
				<artifactId>apt-maven-plugin</artifactId>
				<version>${apt}</version>
				<dependencies>
					<dependency>
						<groupId>com.mysema.querydsl</groupId>
						<artifactId>querydsl-apt</artifactId>
						<version>${querydsl}</version>
					</dependency>
				</dependencies>
				<executions>
					<execution>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>test-process</goal>
						</goals>
						<configuration>
							<outputDirectory>target/generated-sources/annotations</outputDirectory>
							<processor>org.springframework.data.mongodb.repository.support.MongoAnnotationProcessor</processor>
							<logOnlyOnError>true</logOnlyOnError>
							<options>
								<querydsl.excludedPackages>org.springframework.data.rest.webmvc.mongodb.groovy,groovy.lang</querydsl.excludedPackages>
							</options>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

</project>
