<?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.atteo.classindex</groupId>
		<artifactId>parent</artifactId>
		<version>3.11</version>
	</parent>
	<artifactId>classindex</artifactId>
	<packaging>bundle</packaging>
	<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>
		<!-- test dependencies for OSGi test -->
		<dependency>
			<groupId>org.ops4j.pax.exam</groupId>
			<artifactId>pax-exam-junit4</artifactId>
			<version>4.8.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.exam</groupId>
			<artifactId>pax-exam-container-native</artifactId>
			<version>4.8.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.exam</groupId>
			<artifactId>pax-exam-link-mvn</artifactId>
			<version>4.8.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.servicemix.bundles</groupId>
			<artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
			<version>1_2</version>
			<scope>test</scope>
		</dependency>
		<!-- OSGi framework to test with -->
		<dependency>
			<groupId>org.apache.felix</groupId>
			<artifactId>org.apache.felix.framework</artifactId>
			<version>5.4.0</version>
			<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>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
					<testSource>8</testSource>
					<testTarget>8</testTarget>
				</configuration>
			</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>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<_noee>true</_noee>
						<Import-Package>
							<!--enforce empty imports-->
						</Import-Package>
						<Export-Package>org.atteo.classindex</Export-Package>
					</instructions>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<excludes>
						<exclude>*IntegrationTest.java</exclude>
					</excludes>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<systemPropertyVariables>
						<client.bundle.artifact.location>${project.build.directory}/${project.build.finalName}.jar</client.bundle.artifact.location>
						<project.version>${project.version}</project.version>
						<project.build.directory>${project.build.directory}</project.build.directory>
					</systemPropertyVariables>
					<includes>
						<include>*IntegrationTest.java</include>
					</includes>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
