<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>io.github.lorenzobettini.xtextutils</groupId>
		<artifactId>releng</artifactId>
		<version>0.7.2</version>
		<relativePath>../../releng/io.github.lorenzobettini.xtextutils.releng</relativePath>
	</parent>
	<artifactId>xtext-maven-parent</artifactId>
	<packaging>pom</packaging>

	<name>Xtext Maven Parent</name>
	<description>An Xtext Parent POM for building Xtext DSLs as pure Maven projects.</description>

	<properties>
		<xtextVersion>2.26.0</xtextVersion>
		<mwe2Version>2.12.2</mwe2Version>
		<!-- overridable properties of used plugins -->
		<build-helper-maven-plugin-version>3.2.0</build-helper-maven-plugin-version>
		<exec-maven-plugin-version>3.0.0</exec-maven-plugin-version>
		<maven-surefire-plugin-version>2.22.2</maven-surefire-plugin-version>
		<maven-antrun-plugin-version>3.0.0</maven-antrun-plugin-version>
		<maven-resources-plugin-version>3.2.0</maven-resources-plugin-version>
		<maven-clean-plugin-version>3.1.0</maven-clean-plugin-version>
		<jacoco-maven-plugin-version>0.8.7</jacoco-maven-plugin-version>
		<!-- Define overridable properties for maven-surefire-plugin -->
		<systemProperties></systemProperties>
		<additionalTestArguments></additionalTestArguments>
		<coverageTestArguments></coverageTestArguments>
		<surefireModuleProperties></surefireModuleProperties>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>xtext-dev-bom</artifactId>
				<version>${xtextVersion}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<!-- Note: Xtext artifacts should be mentioned in xtext-dev-bom -->
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext.testing</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext.xbase.testing</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext.xbase</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext.xtext.generator</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext.ide</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>org.eclipse.xtext.xbase.ide</artifactId>
				<version>${xtextVersion}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>${maven-clean-plugin-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>${maven-resources-plugin-version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>${maven-antrun-plugin-version}</version>
				</plugin>
				<plugin>
					<!-- projects should bind to the phase explicitly, e.g., "initialize" -->
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>${build-helper-maven-plugin-version}</version>
					<executions>
						<execution>
							<id>add-xtext-gen-source</id>
							<phase>none</phase>
							<goals>
								<goal>add-source</goal>
								<goal>add-resource</goal>
							</goals>
						</execution>
						<execution>
							<id>add-xtext-gen-test-source</id>
							<phase>none</phase>
							<goals>
								<goal>add-test-source</goal>
								<goal>add-test-resource</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<!-- configured but not enabled, see profile mwe2-launcher -->
					<!-- This relies on the property mwe2-file that is meant to be relative
						to the project directory, e.g., something like
						<mwe2-file>src/org/xtext/example/mydsl/GenerateMyDsl.mwe2</mwe2-file>
						 -->
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>${exec-maven-plugin-version}</version>
					<executions>
						<execution>
							<id>mwe2Launcher</id>
							<goals>
								<goal>java</goal>
							</goals>
							<configuration>
								<arguments>
									<argument>/${project.basedir}/${mwe2-file}</argument>
									<argument>-p</argument>
									<argument>rootPath=/${project.basedir}/..</argument>
								</arguments>
								<skip>true</skip> <!-- configured but not enabled, see profile mwe2-launcher -->
								<mainClass>org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher</mainClass>
								<classpathScope>compile</classpathScope>
								<!-- we don't use includePluginDependencies since Tycho 2.4.0
									handles additional.bundles in build.properties correctly -->
								<cleanupDaemonThreads>false</cleanupDaemonThreads><!-- see https://bugs.eclipse.org/bugs/show_bug.cgi?id=475098#c3 -->
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<!-- configured but not enabled, see profile xtend-compile -->
					<groupId>org.eclipse.xtend</groupId>
					<artifactId>xtend-maven-plugin</artifactId>
					<version>${xtextVersion}</version>
				</plugin>
				<plugin>
					<groupId>org.eclipse.xtext</groupId>
					<artifactId>xtext-maven-plugin</artifactId>
					<version>${xtextVersion}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire-plugin-version}</version>
					<configuration>
						<argLine>${surefireModuleProperties} ${coverageTestArguments} ${systemProperties} ${additionalTestArguments}</argLine>
						<!-- workaround for https://issues.apache.org/jira/browse/SUREFIRE-1588 -->
						<useSystemClassLoader>false</useSystemClassLoader>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco-maven-plugin-version}</version>
					<configuration>
						<excludes>
							<!-- Antlr generated Java classes -->
							<exclude>**/antlr/**/*.class</exclude>
							<!-- We don't have a custom serializer -->
							<exclude>**/serializer/*.class</exclude>
							<!-- generated files -->
							<exclude>**/*Abstract*RuntimeModule.class</exclude>
							<exclude>**/*StandaloneSetup*.class</exclude>
							<exclude>**/*Abstract*Validator.class</exclude>
							<exclude>**/*Abstract*ScopeProvider.class</exclude>
							<exclude>**/*GrammarAccess*.class</exclude>
							<exclude>**/*Abstract*UiModule.class</exclude>
							<exclude>**/**ExecutableExtensionFactory.class</exclude>
							<exclude>**/*Abstract*ProposalProvider.class</exclude>
							<exclude>**/internal/*.class</exclude>
							<exclude>**/*ProjectTemplateProvider.class</exclude>
							<exclude>**/*ProjectTemplate.class</exclude>
						</excludes>
					</configuration>
					<executions>
						<execution>
							<id>prepare-agent</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<propertyName>jacoco-agent</propertyName>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<!--This plugin's configuration is used to store Eclipse m2e settings only.
						It has no influence on the Maven build itself. -->
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											build-helper-maven-plugin
										</artifactId>
										<versionRange>
											[1.9.1,)
										</versionRange>
										<goals>
											<goal>add-resource</goal>
											<goal>add-source</goal>
											<goal>add-test-resource</goal>
											<goal>add-test-source</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											exec-maven-plugin
										</artifactId>
										<versionRange>
											[1.2.1,)
										</versionRange>
										<goals>
											<goal>java</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.apache.maven.plugins
										</groupId>
										<artifactId>
											maven-antrun-plugin
										</artifactId>
										<versionRange>
											[1.6.0,)
										</versionRange>
										<goals>
											<goal>run</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>jdk16-or-newer</id>
			<activation>
				<jdk>[16,)</jdk>
			</activation>
			<properties>
				<!--
				Required to avoid errors of the shape:
				com.google.inject.internal.util.$ComputationException: com.google.inject.internal.util.$ComputationException: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.cglib.core.$ReflectUtils
				Caused by: com.google.inject.internal.util.$ComputationException: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.cglib.core.$ReflectUtils
				Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.google.inject.internal.cglib.core.$ReflectUtils
				 -->
				<surefireModuleProperties>--add-opens java.base/java.lang=ALL-UNNAMED</surefireModuleProperties>
			</properties>
		</profile>
		<profile>
			<id>mwe2-launcher</id>
			<!-- This profile will be activated when the system property "skipMWE2" is not defined,
				or is defined with a value which is not "true"; most of the configuration is done
				in the default pluginManagement section above -->
			<activation>
				<property>
					<name>skipMWE2</name>
					<value>!true</value>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.codehaus.mojo</groupId>
							<artifactId>exec-maven-plugin</artifactId>
							<executions>
								<execution>
									<id>mwe2Launcher</id>
									<configuration>
										<skip>false</skip>
									</configuration>
								</execution>
							</executions>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<profile>
			<id>xtend-compile</id>
			<!-- This profile will be activated when the system property "skipXtend" is not defined,
				or is defined with a value which is not "true" -->
			<activation>
				<property>
					<name>skipXtend</name>
					<value>!true</value>
				</property>
			</activation>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.eclipse.xtend</groupId>
							<artifactId>xtend-maven-plugin</artifactId>
							<version>${xtextVersion}</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>${basedir}/src/main/xtend-gen</outputDirectory>
								<testOutputDirectory>${basedir}/src/test/xtend-gen</testOutputDirectory>
							</configuration>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-clean-plugin</artifactId>
							<configuration>
								<filesets>
									<fileset>
										<directory>${basedir}/src/main/xtend-gen</directory>
										<includes>
											<include>**/*</include>
										</includes>
										<excludes>
											<exclude>**/.gitignore</exclude>
										</excludes>
									</fileset>
									<fileset>
										<directory>${basedir}/src/test/xtend-gen</directory>
										<includes>
											<include>**/*</include>
										</includes>
										<excludes>
											<exclude>**/.gitignore</exclude>
										</excludes>
									</fileset>
								</filesets>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
		<profile>
			<!-- Activated if the directory 'src/main/xtend-gen' is found
				in the base dir of a project -->
			<id>src-main-xtend-gen</id>
			<activation>
				<file>
					<exists>src/main/xtend-gen</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<!-- enabled unless another profile disables xtend-maven-plugin,
							see profile xtend-compile -->
						<groupId>org.eclipse.xtend</groupId>
						<artifactId>xtend-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<!-- Activated if the directory 'src/test/xtend-gen' is found
				in the base dir of a project -->
			<id>src-test-xtend-gen</id>
			<activation>
				<file>
					<exists>src/test/xtend-gen</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<!-- enabled unless another profile disables xtend-maven-plugin,
							see profile xtend-compile -->
						<groupId>org.eclipse.xtend</groupId>
						<artifactId>xtend-maven-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>jacoco</id>
			<properties>
				<coverageTestArguments>${jacoco-agent}</coverageTestArguments>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
					</plugin>
				</plugins>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.eclipse.xtend</groupId>
							<artifactId>xtend-maven-plugin</artifactId>
							<configuration>
								<xtendAsPrimaryDebugSource>true</xtendAsPrimaryDebugSource>
							</configuration>
						</plugin>
					</plugins>
				</pluginManagement>
			</build>
		</profile>
	</profiles>

	<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>

</project>
