<?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>
		<artifactId>parent</artifactId>
		<groupId>org.atteo.classindex</groupId>
		<version>3.4</version>
	</parent>
	<artifactId>classindex</artifactId>
	<name>Atteo Class Index</name>
	<dependencies>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<executions>
					<execution>
						<id>default-compile</id>
						<goals>
							<goal>compile</goal>
						</goals>
						<configuration>
							<proc>none</proc>
						</configuration>
					</execution>
					<execution>
						<id>compile-important-processor</id>
						<phase>process-test-sources</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration>
							<proc>none</proc>
							<testIncludes>
								<include>org/atteo/classindex/processor/*</include>
							</testIncludes>
						</configuration>
					</execution>
					<execution>
						<id>default-testCompile</id>
						<configuration>
							<testExcludes>
								<exclude>org/atteo/classindex/SecondService.java</exclude>
							</testExcludes>
							<useIncrementalCompilation>false</useIncrementalCompilation>
						</configuration>
					</execution>
					<execution>
						<id>compileSecondService</id>
						<phase>test-compile</phase>
						<goals>
							<goal>testCompile</goal>
						</goals>
						<configuration>
							<testIncludes>
								<includes>org/atteo/classindex/SecondService.java</includes>
							</testIncludes>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<phase>process-test-classes</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<delete file="${project.build.testOutputDirectory}/org/atteo/classindex/DeletedComponent.class" />
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.3.1</version>
				<executions>
					<execution>
						<!--
							 Sometimes when annotation processor fails javac returns success, but does not compile any files.
						-->
						<id>check-tests-compile-correctly</id>
						<phase>verify</phase>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireFilesExist>
									<files>
										<file>${project.build.testOutputDirectory}/org/atteo/classindex/ClassIndexTest.class</file>
									</files>
									<message>javac returned success, but did not compile any files</message>
								</requireFilesExist>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>
