<?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>
	<parent>
		<groupId>com.enioka.jqm</groupId>
		<artifactId>jqm-all</artifactId>
		<version>1.2.1</version>
	</parent>

	<artifactId>jqm-tests</artifactId>
	<packaging>pom</packaging>

	<name>JQM test payloads parent</name>
	<url>http://jqm.readthedocs.org</url>

	<modules>
		<module>jqm-test-fibo</module>
		<module>jqm-test-fibohib</module>
		<module>jqm-test-fibosync</module>
		<module>jqm-test-datetimemaven</module>
		<module>jqm-test-datetimemaven2</module>
		<module>jqm-test-datetimemavennopom</module>
		<module>jqm-test-datetimemavennopomlib</module>
		<module>jqm-test-datetimemavenjarinlib</module>
		<module>jqm-test-datetimemavennolibdef</module>
		<module>jqm-test-deliverable</module>
		<module>jqm-test-geo</module>
		<module>jqm-test-jndijms-amq</module>
		<module>jqm-test-checkargs</module>
		<module>jqm-test-defcon</module>
		<module>jqm-test-sendmsg</module>
		<module>jqm-test-sendprogress</module>
		<module>jqm-test-datetimesendmsg</module>
		<module>jqm-test-throwable</module>
		<module>jqm-test-em</module>
		<module>jqm-test-exit</module>
		<module>jqm-test-runnable</module>
		<module>jqm-test-main</module>
		<module>jqm-test-main-inject</module>
		<module>jqm-test-runnable-inject</module>
		<module>jqm-test-kill</module>
		<module>jqm-test-kill2</module>
		<module>jqm-test-legacyinheritance</module>
		<module>jqm-test-missingapi</module>
		<module>jqm-test-jndifile</module>
		<module>jqm-test-waitall</module>
		<module>jqm-test-emplusapi</module>
		<module>jqm-test-tmpdir</module>
		<module>jqm-test-providedapi</module>
		<module>jqm-test-apienginestatus</module>
		<module>jqm-test-jmxleak</module>
		<module>jqm-test-embeddedtest</module>
	</modules>

	<profiles>
		<!-- Tests should produce a "test.jar" file - not a traditionally-named jar - to ease their use inside the engine auto tests. The dependency 
			plugin creates that test.jar (by copying the artifact). (We do not actually rename the artifacts, as this would be contrary to Maven Central 
			rules.) Renaming is inside a profile to avoid running it on the parent (pom-packaged) project -->
		<profile>
			<activation>
				<file>
					<missing>../jqm-tests</missing>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>2.8</version>
						<configuration>
							<skip>false</skip>
						</configuration>
						<executions>
							<execution>
								<id>copy</id>
								<phase>package</phase>
								<goals>
									<goal>copy</goal>
								</goals>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>${project.groupId}</groupId>
											<artifactId>${project.artifactId}</artifactId>
											<version>${project.version}</version>
											<type>pom</type>
											<overWrite>true</overWrite>
											<destFileName>pom.xml</destFileName>
										</artifactItem>
										<artifactItem>
											<groupId>${project.groupId}</groupId>
											<artifactId>${project.artifactId}</artifactId>
											<version>${project.version}</version>
											<type>jar</type>
											<overWrite>true</overWrite>
											<destFileName>test.jar</destFileName>
										</artifactItem>
									</artifactItems>
									<outputDirectory>${project.build.directory}</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>