<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>spring-data-jpa-showcase</artifactId>

	<parent>
		<groupId>org.springframework.data.examples</groupId>
		<artifactId>spring-data-jpa-examples</artifactId>
		<version>1.0.0.BUILD-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<name>Spring Data JPA - Refactoring showcase</name>
	<description>Sample project showing how Spring Data JPA eases implementing repositories over a plain JPA/Spring approach</description>

	<build>

		<resources>
			<resource>
				<directory>src/main/resources</directory>
			</resource>
			<resource>
				<directory>src/snippets/resources</directory>
			</resource>
		</resources>

		<plugins>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${basedir}/src/snippets/java</source>
							</sources>
						</configuration>
					</execution>
					<execution>
						<id>add-test-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${basedir}/src/test-snippets/java</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>**/snippets/**/*.java</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>

			<id>querydsl</id>

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

				<dependency>
					<groupId>com.querydsl</groupId>
					<artifactId>querydsl-jpa</artifactId>
					<version>${querydsl.version}</version>
				</dependency>

			</dependencies>

			<build>
				<plugins>
					<plugin>
						<groupId>com.mysema.maven</groupId>
						<artifactId>apt-maven-plugin</artifactId>
						<version>${apt.version}</version>
						<dependencies>
							<dependency>
								<groupId>com.querydsl</groupId>
								<artifactId>querydsl-apt</artifactId>
								<version>${querydsl.version}</version>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<phase>generate-sources</phase>
								<goals>
									<goal>process</goal>
								</goals>
								<configuration>
									<outputDirectory>target/generated-sources/queries</outputDirectory>
									<processor>com.querydsl.apt.jpa.JPAAnnotationProcessor</processor>
									<logOnlyOnError>true</logOnlyOnError>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>