<?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>com.metreeca</groupId>
	<artifactId>metreeca-base</artifactId>
	<version>1.0.0</version>
	<packaging>pom</packaging>

	<name>Metreeca JSON-LD Server</name>
	<description>Modular components for rapid JSON-LD server development.</description>
	<url>https://github.com/metreeca/base</url>
	<inceptionYear>2013</inceptionYear>

	<organization>
		<name>Metreeca</name>
		<url>https://www.metreeca.com/</url>
	</organization>

	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Metreeca</name>
			<email>info@metreeca.com</email>
			<organization>Metreeca</organization>
			<organizationUrl>https://www.metreeca.com/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git@github.com:metreeca/base.git</connection>
		<developerConnection>scm:git:git@github.com:metreeca/base.git</developerConnection>
		<url>https://github.com/metreeca/base</url>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/metreeca/base/issues</url>
	</issueManagement>

	<distributionManagement>

		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/releases</url>
		</repository>

		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>

	</distributionManagement>

	<properties>

		<java.version>11</java.version>
		<maven.version>3.6</maven.version>

		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

	</properties>

	<dependencyManagement>
		<dependencies>

			<dependency>  <!-- https://search.maven.org/artifact/org.junit.jupiter/junit-bom -->
				<groupId>org.junit</groupId>
				<artifactId>junit-bom</artifactId>
				<version>5.7.1</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>

			<dependency> <!-- https://search.maven.org/artifact/org.assertj/assertj-core -->
				<groupId>org.assertj</groupId>
				<artifactId>assertj-core</artifactId>
				<version>3.19.0</version>
				<scope>test</scope>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<build>

		<plugins>

			<plugin> <!-- https://maven.apache.org/enforcer/maven-enforcer-plugin/ -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>3.0.0</version>

				<executions>
					<execution>

						<id>enforce-maven</id>

						<goals>
							<goal>enforce</goal>
						</goals>

						<configuration>
							<rules>
								<requireMavenVersion>
									<version>${maven.version}</version>
								</requireMavenVersion>
							</rules>
						</configuration>

					</execution>
				</executions>

			</plugin>

			<plugin> <!-- https://maven.apache.org/plugins/maven-compiler-plugin -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>

				<configuration>

					<source>${java.version}</source>
					<target>${java.version}</target>

				</configuration>

			</plugin>

			<plugin> <!-- https://maven.apache.org/surefire/maven-surefire-plugin/ -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M5</version>

			</plugin>

			<plugin> <!-- https://maven.apache.org/plugins/maven-jar-plugin/ -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>

				<configuration>

					<archive>

						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
							<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
						</manifest>

						<manifestEntries>
							<Built-By>${project.organization.name}</Built-By>
							<Built-On>${maven.build.timestamp}</Built-On>
							<Implementation-Version>${project.version}</Implementation-Version>
						</manifestEntries>

					</archive>

				</configuration>

			</plugin>

			<plugin> <!-- https://maven.apache.org/plugins/maven-source-plugin -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.2.1</version>

				<executions>
					<execution>

						<id>attach-sources</id>
						<phase>package</phase>

						<goals>
							<goal>jar-no-fork</goal>
						</goals>

					</execution>
				</executions>

			</plugin>

			<plugin> <!-- https://maven.apache.org/plugins/maven-javadoc-plugin/ -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.3.1</version>

				<configuration>

					<notimestamp>true</notimestamp> <!-- avoid immaterial VCS visible changes -->

					<!-- !!! replace with shared assets (see https://stackoverflow.com/questions/30507476#30668813) -->
					<!--<stylesheetfile>${maven.multiModuleProjectDirectory}/docs/assets/javadocs.css</stylesheetfile>-->

				</configuration>

				<executions>

					<execution>

						<id>attach-javadocs</id>
						<phase>package</phase>

						<goals>
							<goal>jar</goal>
						</goals>

					</execution>

				</executions>

			</plugin>

			<plugin> <!-- https://maven.apache.org/plugins/maven-deploy-plugin/ -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>3.0.0-M1</version>

				<configuration>
					<skip>true</skip>
				</configuration>

			</plugin>

		</plugins>
	</build>

	<profiles>
		<profile>

			<id>release</id>

			<build>
				<plugins>

					<plugin> <!-- http://maven.apache.org/plugins/maven-gpg-plugin/ -->

						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.0.1</version>

						<configuration>
							<executable>gpg</executable>
							<passphraseServerId>gpg.metreeca</passphraseServerId>
						</configuration>

						<executions>
							<execution>

								<id>sign-artifacts</id>
								<phase>verify</phase>

								<goals>
									<goal>sign</goal>
								</goals>

							</execution>
						</executions>

					</plugin>

					<plugin> <!-- https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-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>true</autoReleaseAfterClose>
						</configuration>

					</plugin>

				</plugins>
			</build>

		</profile>
	</profiles>

</project>
