<?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>
	<groupId>tools.mdsd</groupId>
	<artifactId>eclipse-parent</artifactId>	
	<version>0.3.1</version>
	<name>${project.artifactId}</name>
	<description>A common parent POM for all Eclipse builds of MDSD.tools.</description>
	<url>http://mdsd.tools</url>
	<packaging>pom</packaging>

	<licenses>
		<license>
			<name>The Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Stephan Seifermann</name>
			<email>stephan.seifermann@kit.edu</email>
			<organization>Karlsruhe Institute of Technology (KIT), Germany</organization>
			<organizationUrl>http://kit.edu</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git://github.com/mdsd-tools/maven-build-parents.git</connection>
		<developerConnection>scm:git:ssh://github.com/mdsd-tools/maven-build-parents.git</developerConnection>
		<url>http://github.com/mdsd-tools/maven-build-parents/tree/master</url>
	</scm>

	<properties>
		<tycho.version>1.3.0</tycho.version>
		<org.palladiosimulator.maven.tychotprefresh.version>0.2.4</org.palladiosimulator.maven.tychotprefresh.version>
		<javadoc.args>
			-tag "generated:a:Generated class or method."
			-tag "model:a:EMF model class or method."
			-tag "ordered:a:Ordered collection."
			-tag 'noimplement:a:Restriction:'
			-tag 'noextend:a:Restriction:'
			-tag 'noreference:a:Restriction:'
			-tag 'noinstantiate:a:Restriction:'
			-tag 'nooverride:a:Restriction:'
			-tag 'category:a:Category:'
			-link ${java.api.doc}
			-link http://help.eclipse.org/2019-06/topic/org.eclipse.platform.doc.isv/reference/api
			-link https://download.eclipse.org/modeling/emf/emf/javadoc/2.11/
			-link https://download.eclipse.org/modeling/emft/mwe/javadoc/2.9/
		</javadoc.args>
		<!-- The property is meant to be overridden but still has to contain valid content, so we just repeat valid content. -->
		<javadoc.additional.args>
			-link ${java.api.doc}
		</javadoc.additional.args>
	</properties>

	<profiles>

		<!-- Build configuration of parent POM itself -->
		<profile>
			<id>local-build-deployable</id>
			<!-- activate this profile explicitly by adding -Plocal-build-deployable to the maven command -->
			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
				<repository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- Profiles to be inherited -->

		<profile>
			<id>nightly</id>
			<activation>
				<property>
					<name>!release</name>
				</property>
			</activation>
			<properties>
				<org.palladiosimulator.maven.tychotprefresh.filter.0>nightly</org.palladiosimulator.maven.tychotprefresh.filter.0>
			</properties>
		</profile>

		<profile>
			<id>release</id>
			<activation>
				<property>
					<name>release</name>
				</property>
			</activation>
			<properties>
				<org.palladiosimulator.maven.tychotprefresh.filter.0>release</org.palladiosimulator.maven.tychotprefresh.filter.0>
			</properties>
		</profile>


		<profile>
			<id>default-plugin-usage</id>
			<activation>
				<file>
					<missing>.maven_disable_default-plugin-usage</missing>
				</file>
			</activation>
			<build>
				<plugins>
					<!-- Build (tycho target platform) -->
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>target-platform-configuration</artifactId>
					</plugin>
					<plugin>
						<groupId>org.palladiosimulator</groupId>
						<artifactId>tycho-tp-refresh-maven-plugin</artifactId>
					</plugin>

					<!-- Build (general) -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-compiler-plugin</artifactId>
					</plugin>

					<!-- Build (tycho) -->
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-source-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho.extras</groupId>
						<artifactId>tycho-source-feature-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-p2-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-maven-plugin</artifactId>
						<extensions>true</extensions>
					</plugin>

					<!-- Cleanup -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-clean-plugin</artifactId>
					</plugin>

					<!-- Tests -->
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-surefire-plugin</artifactId>
					</plugin>

				</plugins>
			</build>
		</profile>

		<!-- JavaDoc for update site projects -->
		<profile>
			<id>tycho-javadoc-for-updatesite</id>
			<activation>
				<file>
					<exists>category.xml</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.palladiosimulator</groupId>
						<artifactId>tycho-document-bundle-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>compile-xtend</id>
			<activation>
				<file>
					<missing>.maven_disable_compile-xtend</missing>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.xtend</groupId>
						<artifactId>xtend-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>default-plugin-configurations</id>
			<activation>
				<file>
					<missing>.maven_disable_default-plugin-configurations</missing>
				</file>
			</activation>
			<properties>
				<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
				<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
				<java.version>11</java.version>
				<java.api.doc>https://docs.oracle.com/en/java/javase/11/docs/api/</java.api.doc>
				<maven.compiler.target>${java.version}</maven.compiler.target>
				<maven.compiler.source>${java.version}</maven.compiler.source>
			</properties>
			<build>
				<pluginManagement>
					<plugins>

						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-compiler-plugin</artifactId>
							<version>3.8.1</version>
						</plugin>

						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-source-plugin</artifactId>
							<version>${tycho.version}</version>
							<executions>
								<execution>
									<id>plugin-source</id>
									<goals>
										<goal>plugin-source</goal>
									</goals>
								</execution>
							</executions>
						</plugin>

						<plugin>
							<groupId>org.eclipse.tycho.extras</groupId>
							<artifactId>tycho-source-feature-plugin</artifactId>
							<version>${tycho.version}</version>
							<executions>
								<execution>
									<id>source-feature</id>
									<goals>
										<goal>source-feature</goal>
									</goals>
								</execution>
							</executions>
						</plugin>

						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-p2-plugin</artifactId>
							<version>${tycho.version}</version>
							<executions>
								<execution>
									<id>attached-p2-metadata</id>
									<phase>package</phase>
									<goals>
										<goal>p2-metadata</goal>
									</goals>
								</execution>
							</executions>
						</plugin>

						<plugin>
							<groupId>org.eclipse.xtend</groupId>
							<artifactId>xtend-maven-plugin</artifactId>
							<version>2.18.0</version>
							<executions>
								<execution>
									<goals>
										<goal>compile</goal>
									</goals>
									<configuration>
										<outputDirectory>xtend-gen</outputDirectory>
									</configuration>
								</execution>
							</executions>
						</plugin>

						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-clean-plugin</artifactId>
							<version>3.1.0</version>
							<executions>
								<execution>
									<id>gen-clean</id>
									<phase>clean</phase>
									<goals>
										<goal>clean</goal>
									</goals>
									<configuration>
										<filesets>
											<fileset>
												<directory>xtend-gen</directory>
											</fileset>
										</filesets>
									</configuration>
								</execution>
							</executions>
						</plugin>

						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-maven-plugin</artifactId>
							<version>${tycho.version}</version>
							<extensions>true</extensions>
						</plugin>

						<plugin>
							<groupId>org.jacoco</groupId>
							<artifactId>jacoco-maven-plugin</artifactId>
							<version>0.8.4</version>
							<executions>
								<execution>
									<id>jacoco-prepare</id>
									<phase>generate-test-sources</phase>
									<goals>
										<goal>prepare-agent</goal>
									</goals>
								</execution>
							</executions>
						</plugin>

						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-surefire-plugin</artifactId>
							<version>${tycho.version}</version>
							<configuration>
								<includes>
									<include>**/*Test.java</include>
									<include>**/*Tests.java</include>
								</includes>
								<failIfNoTests>false</failIfNoTests>
							</configuration>
						</plugin>

						<plugin>
							<groupId>org.palladiosimulator</groupId>
							<artifactId>tycho-document-bundle-plugin</artifactId>
							<version>1.1.4</version>
							<executions>
								<execution>
									<id>eclipse-javadoc</id>
									<phase>generate-resources</phase>
									<goals>
										<goal>javadoc</goal>
									</goals>
									<configuration>
										<outputDirectory>${project.build.directory}/repository/javadoc</outputDirectory>
										<exportOnly>false</exportOnly>
										<skipTocGen>true</skipTocGen>
										<javadocOptions>
											<additionalArguments>
												<additionalArgument>${javadoc.args}</additionalArgument>
												<additionalArgument>${javadoc.additional.args}</additionalArgument>
											</additionalArguments>
										</javadocOptions>
									</configuration>
								</execution>
							</executions>
						</plugin>

					</plugins>
				</pluginManagement>
			</build>
		</profile>

		<profile>
			<id>execute-generate-workflow</id>
			<activation>
				<file>
					<exists>workflow/generate.mwe2</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.6.0</version>
						<executions>
							<execution>
								<id>ExecuteMWE2LauncherForGenerate</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>java</goal>
								</goals>
								<configuration>
									<mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
									<arguments>
										<argument>/${project.basedir}/workflow/generate.mwe2</argument>
										<argument>-p</argument>
										<argument>workspaceRoot=/${maven.multiModuleProjectDirectory}</argument>
									</arguments>
									<classpathScope>compile</classpathScope>
									<includePluginDependencies>true</includePluginDependencies>
									<cleanupDaemonThreads>false</cleanupDaemonThreads><!-- see https://bugs.eclipse.org/bugs/show_bug.cgi?id=475098#c3 -->
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>execute-clean-workflow</id>
			<activation>
				<file>
					<exists>workflow/clean.mwe2</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.6.0</version>
						<executions>
							<execution>
								<id>ExecuteMWE2LauncherForClean</id>
								<phase>clean</phase>
								<goals>
									<goal>java</goal>
								</goals>
								<configuration>
									<mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
									<arguments>
										<argument>/${project.basedir}/workflow/clean.mwe2</argument>
										<argument>-p</argument>
										<argument>workspaceRoot=/${maven.multiModuleProjectDirectory}</argument>
									</arguments>
									<classpathScope>compile</classpathScope>
									<includePluginDependencies>true</includePluginDependencies>
									<cleanupDaemonThreads>false
									</cleanupDaemonThreads><!-- see https://bugs.eclipse.org/bugs/show_bug.cgi?id=475098#c3 -->
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<!-- OS specific properties -->
		<profile>
			<id>win32-amd64</id>
			<activation>
				<os>
					<arch>amd64</arch>
					<family>windows</family>
				</os>
			</activation>
			<properties>
				<target.platform.os>win32</target.platform.os>
				<target.platform.ws>win32</target.platform.ws>
				<target.platform.arch>x86_64</target.platform.arch>
			</properties>
		</profile>
		<profile>
			<id>linux-amd64</id>
			<activation>
				<os>
					<arch>amd64</arch>
					<family>unix</family>
					<name>linux</name>
				</os>
			</activation>
			<properties>
				<target.platform.os>linux</target.platform.os>
				<target.platform.ws>gtk</target.platform.ws>
				<target.platform.arch>x86_64</target.platform.arch>
			</properties>
		</profile>
		<profile>
			<id>cocoa-macosx-x86_64</id>
			<activation>
				<os>
					<arch>x86_64</arch>
					<family>unix</family>
					<name>mac os x</name>
				</os>
			</activation>
			<properties>
				<target.platform.os>macosx</target.platform.os>
				<target.platform.ws>cocoa</target.platform.ws>
				<target.platform.arch>x86_64</target.platform.arch>
			</properties>
		</profile>

	</profiles>

</project>