<?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.eclipse.glsp</groupId>
	<artifactId>org.eclipse.glsp.parent</artifactId>
	<description>GLSP Parent pom </description>
	<version>2.3.0</version>
	<packaging>pom</packaging>

	<name>GLSP Parent</name>

	<url>https://www.eclipse.org/glsp</url>
	<licenses>
		<license>
			<name>Eclipse Public License - v 2.0</name>
			<url>http://www.eclipse.org/legal/epl-v20.html</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Eclipse GLSP Project</name>
			<email>glsp-dev@eclipse.org</email>
			<organization>Eclipse GLSP</organization>
			<organizationUrl>https://projects.eclipse.org/projects/ecd.glsp</organizationUrl>
		</developer>
	</developers>

	<scm>
		<url>https://github.com/eclipse-glsp/glsp-server</url>
		<connection>scm:git@github.com:eclipse-glsp/glsp-server.git</connection>
		<developerConnection>scm:git@github.com:eclipse-glsp/glsp-server.git</developerConnection>
		<tag>HEAD</tag>
	</scm>

	<properties>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.source>17</java.source>
		<java.target>17</java.target>
		<project.build.java.target>17</project.build.java.target>

		<!-- Maven Plugin Versions: General maven plugin versions -->
		<buildhelper.maven.version>3.6.0</buildhelper.maven.version>
		<emfcloud.checkstyle.version>0.1.0-SNAPSHOT</emfcloud.checkstyle.version>
		<maven.antrun.version>3.1.0</maven.antrun.version>
		<maven.checkstyle.version>3.4.0</maven.checkstyle.version>
		<maven.clean.version>3.4.0</maven.clean.version>
		<maven.compiler.version>3.11.0</maven.compiler.version>
		<maven.dependency.version>3.7.1</maven.dependency.version>
		<maven.deploy.version>3.1.2</maven.deploy.version>
		<maven.failsafe.version>3.3.1</maven.failsafe.version>
		<maven.javadoc.version>3.8.0</maven.javadoc.version>
		<maven.resources.version>3.3.1</maven.resources.version>
		<maven.shade.version>3.6.0</maven.shade.version>
		<maven.source.version>3.3.1</maven.source.version>
		<maven.surefire.version>3.3.1</maven.surefire.version>
		<tycho.version>4.0.8</tycho.version>
		<versions.maven.version>2.17.1</versions.maven.version>

		<!-- Dependency Versions: Version of dependencies provided by the target 
			platform in ,2. We try to match the p2-version if possible. -->
		<apache.logging.log4j.version>[2.19.0,2.24.2]</apache.logging.log4j.version>
		<commons.cli.version>[1.4,)</commons.cli.version>
		<elk.version>0.8.1</elk.version>
		<emf.common.version>[2.29.0,)</emf.common.version>
		<emf.ecore.change.version>[2.14.0,)</emf.ecore.change.version>
		<emf.ecore.edit.version>[2.14.0,)</emf.ecore.edit.version>
		<emf.ecore.version>[2.35.0,)</emf.ecore.version>
		<emf.ecore.xmi.version>[2.35.0,)</emf.ecore.xmi.version>
		<google.guice.version>[7.0.0,)</google.guice.version>
		<google.gson.version>[2.10.1,)</google.gson.version>
		<junit.jupiter.engine.version>[5.7.1,6.0.0)</junit.jupiter.engine.version>
		<lsp4j.version>[0.21.0,)</lsp4j.version>
		<jetty.websocket.version>[12.0.3,)</jetty.websocket.version>


		<!-- Release Dependencies for M2 -->
		<nexus.maven.version>1.6.13</nexus.maven.version>
		<maven.gpg.version>1.6</maven.gpg.version>
	</properties>

	<pluginRepositories>
		<pluginRepository>
			<id>sonatype</id>
			<name>Sonatype</name>
			<url>https://oss.sonatype.org/content/groups/public</url>
		</pluginRepository>
	</pluginRepositories>

	<build>
		<sourceDirectory>src</sourceDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>${maven.compiler.version}</version>
				<configuration>
					<source>${java.source}</source>
					<target>${java.target}</target>
					<generatedSourcesDirectory>src-gen</generatedSourcesDirectory>
				</configuration>
			</plugin>
		</plugins>
	</build>


	<profiles>
		<profile>
			<id>p2</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>

			<properties>
				<!-- Maven Plugin Versions: General maven plugin versions -->
				<p2.target>r2024-09</p2.target>
			</properties>

			<modules>
				<module>plugins/org.eclipse.glsp.server</module>
				<module>plugins/org.eclipse.glsp.server.emf</module>
				<module>plugins/org.eclipse.glsp.server.websocket</module>
				<module>plugins/org.eclipse.glsp.layout</module>
				<module>plugins/org.eclipse.glsp.graph</module>
				<module>examples/org.eclipse.glsp.example.workflow</module>
				<module>releng</module>
			</modules>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-compiler-plugin</artifactId>
							<version>${tycho.version}</version>
						</plugin>
						<!-- enable tycho build extension -->
						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-maven-plugin</artifactId>
							<version>${tycho.version}</version>
							<extensions>true</extensions>
						</plugin>
						<plugin>
							<!-- enable source bundle generation -->
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-source-plugin</artifactId>
							<version>${tycho.version}</version>
						</plugin>
						<plugin>
							<!-- enable automated version updates -->
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>tycho-versions-plugin</artifactId>
							<version>${tycho.version}</version>
						</plugin>
						<plugin>
							<groupId>org.eclipse.tycho</groupId>
							<artifactId>target-platform-configuration</artifactId>
							<version>${tycho.version}</version>
						</plugin>
					</plugins>
				</pluginManagement>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<version>${maven.resources.version}</version>
						<configuration>
							<encoding>UTF-8</encoding>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-maven-plugin</artifactId>
						<extensions>true</extensions>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-compiler-plugin</artifactId>
						<configuration>
							<source>${java.source}</source>
							<target>${java.target}</target>
							<optimize>true</optimize>
							<showWarnings>false</showWarnings>
						</configuration>
					</plugin>
					<plugin>
						<!-- enable source bundle generation -->
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-source-plugin</artifactId>
						<executions>
							<execution>
								<id>plugin-source</id>
								<goals>
									<goal>plugin-source</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<!-- enable automated version updates -->
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>tycho-versions-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>target-platform-configuration</artifactId>
						<configuration>
							<pomDependencies>wrapAsBundle</pomDependencies>
							<targetDefinitionIncludeSource>honor</targetDefinitionIncludeSource>
							<environments>
								<environment>
									<os>win32</os>
									<ws>win32</ws>
									<arch>x86_64</arch>
								</environment>
								<environment>
									<os>linux</os>
									<ws>gtk</ws>
									<arch>x86_64</arch>
								</environment>
								<environment>
									<os>macosx</os>
									<ws>cocoa</ws>
									<arch>x86_64</arch>
								</environment>
							</environments>
							<target>
								<artifact>
									<groupId>org.eclipse.glsp</groupId>
									<artifactId>org.eclipse.glsp.parent</artifactId>
									<classifier>targetplatforms/${p2.target}</classifier>
									<version>${project.version}</version>
								</artifact>
							</target>
							<dependency-resolution>
								<optionalDependencies>ignore</optionalDependencies>
							</dependency-resolution>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>


		<profile>
			<id>m2</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>

			<properties>
				<checkstyle.version>8.44</checkstyle.version>
			</properties>

			<modules>
				<module>plugins/org.eclipse.glsp.graph</module>
				<module>plugins/org.eclipse.glsp.layout</module>
				<module>plugins/org.eclipse.glsp.server</module>
				<module>plugins/org.eclipse.glsp.server.emf</module>
				<module>plugins/org.eclipse.glsp.server.websocket</module>
				<module>examples/org.eclipse.glsp.example.workflow</module>
				<module>tests</module>
			</modules>

			<dependencies>
				<dependency>
					<groupId>org.apache.logging.log4j</groupId>
					<artifactId>log4j-core</artifactId>
					<version>${apache.logging.log4j.version}</version>
				</dependency>
				<dependency>
					<groupId>org.apache.logging.log4j</groupId>
					<artifactId>log4j-slf4j2-impl</artifactId>
					<version>${apache.logging.log4j.version}</version>
				</dependency>
			</dependencies>

			<pluginRepositories>
				<pluginRepository>
					<id>sonatype</id>
					<name>Sonatype</name>
					<url>https://oss.sonatype.org/content/groups/public</url>
				</pluginRepository>
			</pluginRepositories>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>${maven.source.version}</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>${maven.surefire.version}</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<version>${maven.failsafe.version}</version>
					</plugin>
					<!-- to disable use -Dcheckstyle.skip -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<version>${maven.checkstyle.version}</version>
						<configuration>
							<configLocation>emfcloud-checkstyle-${checkstyle.version}.xml</configLocation>
							<consoleOutput>true</consoleOutput>
							<excludes>**/src-gen/**/*.java</excludes>
						</configuration>
						<executions>
							<execution>
								<phase>validate</phase>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>org.eclipse.emfcloud</groupId>
								<artifactId>org.eclipse.emfcloud.checkstyle</artifactId>
								<version>${emfcloud.checkstyle.version}</version>
							</dependency>
							<dependency>
								<groupId>com.puppycrawl.tools</groupId>
								<artifactId>checkstyle</artifactId>
								<version>${checkstyle.version}</version>
							</dependency>
						</dependencies>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>m2-release</id>
			<modules>
				<module>plugins/org.eclipse.glsp.graph</module>
				<module>plugins/org.eclipse.glsp.layout</module>
				<module>plugins/org.eclipse.glsp.server</module>
				<module>plugins/org.eclipse.glsp.server.websocket</module>
				<module>examples/org.eclipse.glsp.example.workflow</module>
			</modules>


			<distributionManagement>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
			</distributionManagement>
			<build>
				<plugins>
					<!-- To release to Sonatype/Maven central -->
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>${nexus.maven.version}</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						</configuration>
					</plugin>
					<!-- To generate javadoc -->

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${maven.javadoc.version}</version>
						<configuration>

							<source>${java.source}</source>
							<detectJavaApiLink>false</detectJavaApiLink>
							<tags>
								<tag>
									<name>generated</name>
									<placement>a</placement>
								</tag>
								<tag>
									<name>model</name>
									<placement>a</placement>
								</tag>
								<tag>
									<name>ordered</name>
									<placement>a</placement>
								</tag>
							</tags>
						</configuration>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<!-- To sign the artifacts -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>${maven.gpg.version}</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-deploy-plugin</artifactId>
						<version>${maven.deploy.version}</version>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>versions-maven-plugin</artifactId>
						<version>${versions.maven.version}</version>
					</plugin>
				</plugins>

			</build>
		</profile>
	</profiles>
</project>