<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>io.github.lorenzobettini.xtextutils</groupId>
	<artifactId>releng</artifactId>
	<version>0.19.0</version>
	<packaging>pom</packaging>

	<name>Xtext Build Utils Releng</name>
	<url>https://github.com/LorenzoBettini/xtext-build-utils</url>
	<description>Utilities for building Xtext DSLs.</description>

	<licenses>
		<license>
			<name>Eclipse Public License</name>
			<url>http://www.eclipse.org/legal/epl-v10.html</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Lorenzo Bettini</name>
			<email>lorenzo.bettini@gmail.com</email>
			<roles>
				<role>architect</role>
				<role>developer</role>
			</roles>
			<organization>DISIA Dipartimento di Statistica, Informatica, Applicazioni</organization>
			<organizationUrl>https://www.disia.unifi.it/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<url>git@github.com:LorenzoBettini/xtext-build-utils.git</url>
		<developerConnection>scm:git:https://github.com/LorenzoBettini/xtext-build-utils.git</developerConnection>
		<connection>scm:git:git@github.com/LorenzoBettini/xtext-build-utils.git</connection>
	</scm>

	<issueManagement>
		<system>Github</system>
		<url>https://github.com/LorenzoBettini/xtext-build-utils/issues</url>
	</issueManagement>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<nexus-staging-url>https://s01.oss.sonatype.org/</nexus-staging-url>
		<xtextVersion>2.38.0</xtextVersion>
		<mwe2Version>2.21.0</mwe2Version>
		<maven-enforcer-plugin-version>3.5.0</maven-enforcer-plugin-version>
		<versions-maven-plugin-version>2.16.2</versions-maven-plugin-version>
		<maven-dependency-plugin-version>3.8.1</maven-dependency-plugin-version>
		<maven-deploy-plugin-version>3.1.4</maven-deploy-plugin-version>
		<maven-install-plugin-version>3.1.4</maven-install-plugin-version>
		<maven-site-plugin-version>4.0.0-M16</maven-site-plugin-version>
		<nexus-staging-maven-plugin-version>1.7.0</nexus-staging-maven-plugin-version>
		<maven-javadoc-plugin-version>3.11.2</maven-javadoc-plugin-version>
		<maven-gpg-plugin-version>3.2.7</maven-gpg-plugin-version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.eclipse.xtext</groupId>
				<artifactId>xtext-dev-bom</artifactId>
				<version>${xtextVersion}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<modules>
		<module>../../xtext-maven-parent/io.github.lorenzobettini.xtextutils.xtext-maven-parent</module>
		<module>../../xtext-tycho-parent/io.github.lorenzobettini.xtextutils.xtext-tycho-parent</module>
	</modules>

	<profiles>
		<profile>
			<!-- This is used only for updating versions also in test projects
				versions:set will scan automatically also these modules
				even if this profile is not active.
				
				Don't run a build with this profile explicitly, unless the parent artifacts
				xtext-tycho-parent and xtext-maven-parent have already been installed locally:
				the parents of test projects do NOT use parent.relativePath -->
			<id>update-versions</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<modules>
				<module>../../testlanguages/maventestlanguage/io.github.lorenzobettini.maventestlanguage.parent</module>
				<module>../../testlanguages/tychotestlanguage/io.github.lorenzobettini.tychotestlanguage.parent</module>
				<module>../../testlanguages/tychopomlesstestlanguage/io.github.lorenzobettini.tychopomlesstestlanguage.parent</module>
				<module>../../testlanguages/tychoxbasetestlanguage/io.github.lorenzobettini.tychoxbasetestlanguage.parent</module>
			</modules>
		</profile>
		<profile>
			<!-- Don't run a build with this profile explicitly, unless the parent artifacts
				xtext-tycho-parent and xtext-maven-parent have already been installed locally:
				the parents of test projects do NOT use parent.relativePath.
				
				Skip the pomless example because we don't have .mvn in this project
				(maybe we could add it?) -->
			<id>testlanguages</id>
			<modules>
				<module>../../testlanguages/maventestlanguage/io.github.lorenzobettini.maventestlanguage.parent</module>
				<module>../../testlanguages/tychotestlanguage/io.github.lorenzobettini.tychotestlanguage.parent</module>
				<module>../../testlanguages/tychoxbasetestlanguage/io.github.lorenzobettini.tychoxbasetestlanguage.parent</module>
			</modules>
		</profile>
		<profile>
			<id>sonatype-oss-release</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
								<configuration>
									<!-- Prevent gpg from using pinentry programs -->
									<gpgArguments>
										<arg>--pinentry-mode</arg>
										<arg>loopback</arg>
									</gpgArguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>${maven-enforcer-plugin-version}</version>
					<executions>
						<execution>
							<id>enforce-maven-version</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>3.9.5</version>
									</requireMavenVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<!-- mvn versions:set -DartifactId='*' -DgenerateBackupPoms=false -DremoveSnapshot=true -->
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>versions-maven-plugin</artifactId>
					<version>${versions-maven-plugin-version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-dependency-plugin</artifactId>
					<version>${maven-dependency-plugin-version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${maven-deploy-plugin-version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-install-plugin</artifactId>
					<version>${maven-install-plugin-version}</version>
				</plugin>
				<plugin>
					<artifactId>maven-site-plugin</artifactId>
					<version>${maven-site-plugin-version}</version>
				</plugin>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>${nexus-staging-maven-plugin-version}</version>
					<extensions>true</extensions>
					<configuration>
						<serverId>ossrh</serverId>
						<nexusUrl>${nexus-staging-url}</nexusUrl>
						<autoReleaseAfterClose>true</autoReleaseAfterClose>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${maven-javadoc-plugin-version}</version>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
							<!-- Use the following configuration with Java 8 -->
							<configuration>
								<doclint>none</doclint>
								<failOnError>false</failOnError>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${maven-gpg-plugin-version}</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

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