<?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>0.8.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>Philip Langer</name>
			<email>planger@eclipsesource.com</email>
			<organization>EclipseSource</organization>
			<organizationUrl>http://www.eclipsesource.com</organizationUrl>
		</developer>
		<developer>
			<name>Tobias Ortmayr</name>
			<email>tortmayr@eclipsesource.com</email>
			<organization>EclipseSource</organization>
			<organizationUrl>http://www.eclipsesource.com</organizationUrl>
		</developer>
		<developer>
			<name>Martin Fleck</name>
			<email>mfleck@eclipsesource.com</email>
			<organization>EclipseSource</organization>
			<organizationUrl>http://www.eclipsesource.com</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>11</java.source>
		<java.target>11</java.target>
		<project.build.java.target>11</project.build.java.target>
		<target.version>0.8.0</target.version>
	</properties>
	<build>
		<sourceDirectory>src</sourceDirectory>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.0</version>
				<configuration>
					<source>${java.source}</source>
					<target>${java.target}</target>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>21.0</version>
		</dependency>
	</dependencies>

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

			<properties>
				<tycho-version>1.6.0</tycho-version>
				<tychoExtrasVersion>1.6.0</tychoExtrasVersion>
				<maven-antrun-plugin.version>1.8</maven-antrun-plugin.version>

			</properties>

			<modules>
				<module>plugins/org.eclipse.glsp.server</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>
							<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>2.7</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>true</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>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>target-platform-configuration</artifactId>
						<configuration>
							<includePackedArtifacts>true</includePackedArtifacts>
							<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/r2020-06</classifier>
									<version>${target.version}</version>
								</artifact>
							</target>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>

		<profile>
			<id>p2-release</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>

			<modules>
				<module>plugins/org.eclipse.glsp.server</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>
		</profile>

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

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

			<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>
<!-- 				<module>tests</module> -->
			</modules>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.0.1</version>
						<configuration>
							<argLine>
								--illegal-access=permit
							</argLine>
						</configuration>
						<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>2.22.1</version>
						<configuration>
							<argLine>
								--illegal-access=permit
							</argLine>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-failsafe-plugin</artifactId>
						<version>2.22.1</version>
						<configuration>
							<argLine>
								--illegal-access=permit
							</argLine>
						</configuration>
					</plugin>

					<!-- to disable use -Dcheckstyle.skip -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-checkstyle-plugin</artifactId>
						<version>3.1.0</version>
						<configuration>
							<configLocation>releng/org.eclipse.glsp.codestyle/checkstyle/glsp-checkstyle.xml</configLocation>
							<consoleOutput>true</consoleOutput>
						</configuration>
						<executions>
							<execution>
								<goals>
									<goal>check</goal>
								</goals>
								<phase>verify</phase>
							</execution>
						</executions>
						<dependencies>
							<dependency>
								<groupId>com.puppycrawl.tools</groupId>
								<artifactId>checkstyle</artifactId>
								<version>8.29</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>1.6.8</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoreleaseafterclose>false</autoreleaseafterclose>
						</configuration>
					</plugin>
					<!-- To generate javadoc -->

					<!-- Deactivate for now. Not needed for snapshot deployments -->
<!-- 					<plugin> -->
<!-- 						<groupId>org.apache.maven.plugins</groupId> -->
<!-- 						<artifactId>maven-javadoc-plugin</artifactId> -->
<!-- 						<version>3.1.0</version> -->
<!-- 						<executions> -->
<!-- 							<execution> -->
<!-- 								<id>attach-javadocs</id> -->
<!-- 								<goals> -->
<!-- 									<goal>jar</goal> -->
<!-- 								</goals> -->
<!-- 								<configuration> -->
<!-- 									<additionalJOption>-Xdoclint:none</additionalJOption> -->
<!-- 									<tags> -->
<!-- 										<tag> -->
<!-- 											<name>generated</name> -->
<!-- 											<placement>a</placement> -->
<!-- 											<head></head> -->
<!-- 										</tag> -->
<!-- 										<tag> -->
<!-- 											<name>ordered</name> -->
<!-- 											<placement>a</placement> -->
<!-- 											<head></head> -->
<!-- 										</tag> -->
<!-- 										<tag> -->
<!-- 											<name>model</name> -->
<!-- 											<placement>a</placement> -->
<!-- 											<head>Model:</head> -->
<!-- 										</tag> -->
<!-- 									</tags> -->
<!-- 								</configuration> -->
<!-- 							</execution> -->
<!-- 						</executions> -->
<!-- 					</plugin> -->

					<!-- To sign the artifacts -->
					<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>
								<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>2.8</version>
						<configuration>
							<skip>true</skip>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>versions-maven-plugin</artifactId>
						<version>2.7</version>
					</plugin>
				</plugins>

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