<?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>org.etsi.mts.tdl.extras</groupId>
	<artifactId>org.etsi.mts.tdl.extras.parent</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<packaging>pom</packaging>

	<modules>
		<!-- Converters -->
		<module>../plugins/org.etsi.mts.tdl.extras.openapi.generator.wrapper</module>
		<module>../plugins/org.etsi.mts.tdl.extras.yang.tools.wrapper.mvn/dependencies</module>
		<module>../plugins/org.etsi.mts.tdl.extras.yang.tools.wrapper.mvn</module>
		<module>../plugins/org.etsi.mts.tdl.extras.yang.tools.wrapper</module>
		<!-- Features -->
		<module>../features/org.etsi.mts.tdl.extras.feature</module> 
		<!-- Update Site -->
		<module>../updatesite/org.etsi.mts.tdl.extras.updatesite</module>
	</modules>
	
	<properties>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>
		<tycho-version>3.0.5</tycho-version>
		<mwe2Version>2.15.0</mwe2Version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<xtext.version>2.32.0</xtext.version>
		<tycho.disableP2Mirrors>true</tycho.disableP2Mirrors>
		<maven.compiler.plugin.version>3.9.0</maven.compiler.plugin.version>
		<maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
		<maven.plugin.validation>VERBOSE</maven.plugin.validation>
	</properties>

	<build>
		<extensions>
			<!-- Uncomment for caching, currently Maven version bundled with Eclipse does not support it -->
			<!-- 
			<extension>
				<groupId>org.apache.maven.extensions</groupId>
				<artifactId>maven-build-cache-extension</artifactId>
				<version>1.0.0</version>
			</extension>
			-->
		</extensions>
		<pluginManagement>
			
			<plugins>
				
				<!-- xtend-maven-plugin is in pluginManagement instead of in plugins 
					so that it doesn't run before the exec-maven-plugin's *.mwe2 gen; this way 
					we can list it after. -->
				<plugin>
					<groupId>org.eclipse.xtend</groupId>
					<artifactId>xtend-maven-plugin</artifactId>
					<version>${xtext.version}</version>
					<executions>
						<execution>
							<goals>
								<goal>compile</goal>
								<goal>xtend-install-debug-info</goal>
								<goal>testCompile</goal>
								<goal>xtend-test-install-debug-info</goal>
							</goals>
						</execution>
					</executions>
					<configuration>
						<outputDirectory>xtend-gen</outputDirectory>
					</configuration>
				</plugin>

				<!-- without this the example-project would also need to use tycho--> 
				<plugin>
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-packaging-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<strictVersions>false</strictVersions>
						<skipPomGeneration>true</skipPomGeneration>
					</configuration>
				</plugin>
				<plugin>
					<!--
						Can be removed after first generator execution
						https://bugs.eclipse.org/bugs/show_bug.cgi?id=480097
					-->
					<groupId>org.eclipse.tycho</groupId>
					<artifactId>tycho-compiler-plugin</artifactId>
					<version>${tycho-version}</version>
					<configuration>
						<compilerArgument>-err:-forbidden</compilerArgument>
						<useProjectSettings>false</useProjectSettings>
					</configuration>
				</plugin>
			
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>2.5</version>
					<executions>
						<execution>
							<id>gen-clean</id>
							<goals>
								<goal>clean</goal>
							</goals>
							<configuration>
								<filesets>
									<fileset>
										<directory>${basedir}/xtend-gen</directory>
									</fileset>
								</filesets>
							</configuration>
						</execution>
					</executions>
				</plugin>
		      <plugin>
		        <artifactId>maven-compiler-plugin</artifactId>
		        <version>${maven.compiler.plugin.version}</version>
		      </plugin>
		      <plugin>
				    <artifactId>maven-jar-plugin</artifactId>
			        <version>${maven.jar.plugin.version}</version>
		      </plugin>

			</plugins>
			
		</pluginManagement>

		<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>tycho-p2-plugin</artifactId>
				<version>${tycho-version}</version>
				<executions>
					<execution>
						<id>attach-p2-metadata</id>
						<phase>package</phase>
						<goals>
							<goal>p2-metadata</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			
			<plugin>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>target-platform-configuration</artifactId>
				<version>${tycho-version}</version>
				<configuration>
					<target>
						<!-- TODO: A bit fragile.. -->
						<file>
							../../org.etsi.mts.tdl.extras.parent/top.extrasx.target
						</file>
					</target>
					<environments>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>macosx</os>
							<ws>cocoa</ws>
							<arch>aarch64</arch>
						</environment>
						<environment>
							<os>win32</os>
							<ws>win32</ws>
							<arch>x86_64</arch>
						</environment>
						<environment>
							<os>linux</os>
							<ws>gtk</ws>
							<arch>x86_64</arch>
						</environment>
					</environments>
					<dependency-resolution>
						<extraRequirements>
							<requirement>
								<type>eclipse-plugin</type>
								<id>org.eclipse.xtext.logging</id>
								<versionRange>1.2.24</versionRange>
							</requirement>
							<!-- to get the org.eclipse.osgi.compatibility.state plugin if the target
								platform is Luna or later. (backward compatible with kepler and previous
								versions) see https://bugs.eclipse.org/bugs/show_bug.cgi?id=492149 -->
							<requirement>
								<type>eclipse-feature</type>
								<id>org.eclipse.rcp</id>
								<versionRange>0.0.0</versionRange>
							</requirement>
						</extraRequirements>
					</dependency-resolution>
				</configuration>
			</plugin>
		</plugins>
	
	</build>
	
	<repositories>
		<repository>
			<id>codehaus-snapshots</id>
			<name>disable dead 'Codehaus Snapshots' repository, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481478</name>
			<url>http://nexus.codehaus.org/snapshots/</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
		<!-- This must be disabled explicitly, otherwise it is enabled by https://github.com/mojohaus/mojo-parent 
			which is taken from exec-maven-plugin from at least version 1.6.0 -->
		<repository>
			<id>ossrh-snapshots</id>
			<name>ossrh-snapshots</name>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
		</repository>
		<!-- This is enabled by /org/sonatype/oss/oss-parent/7 used as parent by 
			org/xtext/antlr-generator/3.2.1 -->
		<repository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>codehaus-snapshots</id>
			<name>disable dead 'Codehaus Snapshots' repository, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=481478</name>
			<url>http://nexus.codehaus.org/snapshots/</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
		<pluginRepository>
			<id>ossrh-snapshots</id>
			<name>ossrh-snapshots</name>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
			<url>http://oss.sonatype.org/content/repositories/snapshots</url>
		</pluginRepository>
		<pluginRepository>
			<id>sonatype-nexus-snapshots</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>false</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
		<profiles>
		<profile>
			<id>macos</id>
			<activation>
				<os>
					<family>mac</family>
				</os>
			</activation>
			<properties>
				<!-- THE FOLLOWING LINE MUST NOT BE BROKEN BY AUTOFORMATTING -->
				<platformSystemProperties>-XstartOnFirstThread</platformSystemProperties>
			</properties>
		</profile>
		<profile>
			<id>jdk9-or-newer</id>
			<activation>
				<jdk>[9,)</jdk>
			</activation>
			<properties>
				<moduleProperties>--add-modules=ALL-SYSTEM</moduleProperties>
			</properties>
		</profile>
	</profiles>

</project>
