<?xml version="1.0" encoding="UTF-8"?>
<!--
	Licensed to the Apache Software Foundation (ASF) under one
	or more contributor license agreements. See the NOTICE file
	distributed with this work for additional information
	regarding copyright ownership. The ASF licenses this file
	to you under the Apache License, Version 2.0 (the
	"License"); you may not use this file except in compliance
	with the License. You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing,
	software distributed under the License is distributed on an
	"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
	KIND, either express or implied. See the License for the
	specific language governing permissions and limitations
	under the License.
-->
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.apache.uima</groupId>
    <artifactId>parent-pom</artifactId>
    <version>4</version>
    <relativePath />
  </parent>

	<groupId>org.apache.uima</groupId>
	<artifactId>org.apache.uima.tools.jcasgen.maven.tests.m2e</artifactId>
	<version>0.9.2-SNAPSHOT</version>
	<packaging>eclipse-test-plugin</packaging>
	<name>JCasGen Maven plugin Eclipse tests</name>
	<description>The tests for the JCasGen Maven plugin when used in Eclipse</description>
	<repositories>
		<repository>
			<id>juno</id>
			<layout>p2</layout>
			<url>http://download.eclipse.org/releases/juno</url>
		</repository>
		<repository>
			<id>m2e</id>
			<url>http://download.eclipse.org/technology/m2e/releases/1.2</url>
			<layout>p2</layout>
		</repository>
	</repositories>
	<properties>
		<tycho-version>0.15.0</tycho-version>
		<main.project.version>@project.version@</main.project.version>
		<main.localRepositoryUrl>@localRepositoryUrl@</main.localRepositoryUrl>
	</properties>
	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-maven-plugin</artifactId>
				<version>${tycho-version}</version>
				<extensions>true</extensions>
			</plugin>
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<resolver>p2</resolver>
					<ignoreTychoRepositories>true</ignoreTychoRepositories>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.7</version>
				<executions>
					<execution>
						<id>copy-projects</id>
						<phase>generate-test-resources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<inherited>false</inherited>
						<configuration>
							<target>
								<!-- Propagate the versions of the UIMA framework into the m2e tests -->
								<copy todir="${project.build.directory}/projects" verbose="yes" overwrite="yes">
									<fileset dir="projects" />
									<filterset>
										<filter token="project.version" value="${main.project.version}" />
									</filterset>
								</copy>
								<!-- Propagate the jcasgen-maven-plugin artifact being built into the m2e tests -->
								<copy file="settings-template.xml" tofile="${project.build.directory}/../settings.xml" verbose="yes" overwrite="yes">
									<filterset>
										<filter token="localRepositoryUrl" value="${main.localRepositoryUrl}" />
									</filterset>
								</copy>
							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-surefire-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<!-- useUIHarness>true</useUIHarness -->
						<includes>
							<include>**/*Test.java</include>
						</includes>
						<argLine>${tycho.test.jvmArgs}</argLine>
						<!-- kill test JVM it tests take more than 10 minutes (600 seconds)
                         to finish -->
						<forkedProcessTimeoutInSeconds>7200</forkedProcessTimeoutInSeconds>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>

	</build>
	<profiles>
		<profile>
			<id>sun-jvm</id>
			<activation>
				<property>
					<name>java.vendor.url</name>
					<value>http://java.sun.com/</value>
				</property>
			</activation>
			<properties>
				<tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m</tycho.test.jvmArgs>
			</properties>
		</profile>
		<profile>
			<id>osx</id>
			<activation>
				<property>
					<name>java.vendor.url</name>
					<value>http://www.apple.com/</value>
				</property>
			</activation>
			<properties>
				<tycho.test.jvmArgs>-Xmx800m -XX:MaxPermSize=256m -XstartOnFirstThread</tycho.test.jvmArgs>
			</properties>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-surefire-plugin</artifactId>
							<version>${tycho-version}</version>
							<configuration>
								<dependencies>
									<dependency>
										<artifactId>org.eclipse.jdt.launching.macosx</artifactId>
										<version>3.2.100</version>
										<type>eclipse-plugin</type>
									</dependency>
								</dependencies>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
	</profiles>
</project>