<?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>org.jboss.tools.targetplatforms</groupId>
		<artifactId>jbdevstudio</artifactId>
		<version>4.51.0.Final</version>
	</parent>
	<artifactId>jbdevstudio-multiple</artifactId>
	<name>JBDS Multiple (Composite) Target Platform</name>
	<packaging>pom</packaging>

	<properties>
		<!-- set this to false to allow validation to proceed but NOT fail the build -->
		<validate-target-platform.failOnError>true</validate-target-platform.failOnError>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.eclipse.tycho.extras</groupId>
				<artifactId>target-platform-validation-plugin</artifactId>
				<version>${tychoExtrasVersion}</version>
				<executions>
					<execution>
						<phase>verify</phase>
						<goals>
 							<goal>validate-target-platform</goal>
						</goals>
						<configuration>
							<targetFiles>
								<param>${project.artifactId}.target</param>
							</targetFiles>
							<failOnError>${validate-target-platform.failOnError}</failOnError>
							<checkDependencies>true</checkDependencies>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.3</version>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<!-- add more artifacts if want more target platforms -->
								<artifact>
									<file>${project.artifactId}.target</file>
									<type>target</type>
									<classifier>${project.artifactId}</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>multiple2repo</id>
			<build>
				<plugins>
					<plugin>
						<!-- Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=389052	-->
						<groupId>org.jboss.tools.tycho-plugins</groupId>
						<artifactId>target-platform-utils</artifactId>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>mirror-target-to-repo</goal>
								</goals>
								<configuration>
									<sourceTargetFile>${project.artifactId}.target</sourceTargetFile>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<artifactId>maven-assembly-plugin</artifactId>
						<configuration>
							<descriptors>
								<descriptor>${basedir}/../../publish-assembly.xml</descriptor>
							</descriptors>
							<!-- JBIDE-19800 zip would be jbdevstudio-multiple-4.50.0.Beta1-SNAPSHOT.zip; want jbdevstudiotarget-4.50.0.Beta1-SNAPSHOT.zip -->
							<finalName>${project.parent.artifactId}target-${project.version}</finalName>
						</configuration>
					</plugin>
					<plugin>
						<groupId>net.ju-n.maven.plugins</groupId>
						<artifactId>checksum-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
