<?xml version="1.0" encoding="UTF-8"?>

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Copyright © 2013-2019 Metreeca srl. All rights reserved.

  This file is part of Metreeca/Link.

  Metreeca/Link is free software: you can redistribute it and/or modify it under the terms
  of the GNU Affero General Public License as published by the Free Software Foundation,
  either version 3 of the License, or(at your option) any later version.

  Metreeca/Link is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License along with Metreeca/Link.
  If not, see <http://www.gnu.org/licenses/>.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

<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>link</artifactId>
	<version>0.51.0</version>
	<packaging>pom</packaging>

	<name>Metreeca Linked Data Framework</name>
	<description>A declarative model-driven framework for rapid linked data service development.</description>
	<url>https://github.com/metreeca/link</url>
	<inceptionYear>2013</inceptionYear>

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

	<licenses>
		<license>
			<name>GNU Affero General Public License, Version 3</name>
			<url>https://www.gnu.org/licenses/agpl.html</url>
			<distribution>repo</distribution>
		</license>
		<license>
			<name>Custom Commercial License</name>
		</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/link.git</connection>
		<developerConnection>scm:git:git@github.com:metreeca/link.git</developerConnection>
		<url>https://github.com/metreeca/link</url>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/metreeca/link/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>

		<site>
			<id>github-pages</id>
			<url>https://metreeca.github.io/link/reports</url>
		</site>

	</distributionManagement>

	<modules>

		<module>j2ee</module>

		<module>rest</module>
		<module>gate</module>
		<module>form</module>
		<module>tray</module>

		<module>kits</module>

	</modules>

	<properties>

		<java.version>1.8</java.version>
		<rdf4j.version>2.5.0</rdf4j.version>

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

		<maven.deploy.skip>true</maven.deploy.skip> <!-- ossrh public artifact deployment -->
		<maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>

		<timestamp>${maven.build.timestamp}</timestamp> <!-- ;( not directly available to filtered resources -->

	</properties>

	<dependencies> <!-- shared testing dependencies -->

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>5.3.1</version>
			<scope>test</scope>
		</dependency>

		<dependency> <!-- !!! to be removed once tempdir is migrated to core -->
			<groupId>org.junit-pioneer</groupId>
			<artifactId>junit-pioneer</artifactId>
			<version>0.3.0</version>
			<scope>test</scope>
		</dependency>

		<dependency> <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<version>3.12.2</version>
			<scope>test</scope>
		</dependency>

		<dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>1.7.25</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<build>

		<finalName>metreeca-${project.artifactId}-${project.version}</finalName>

		<resources>

			<resource>
				<directory>${basedir}/src/main/resources</directory>
				<filtering>true</filtering>
			</resource>

			<resource>
				<directory>${basedir}/docs/_resources</directory>
				<targetPath>${basedir}/docs</targetPath>
				<filtering>true</filtering>
			</resource>

		</resources>

		<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-M2</version>

				<executions>
					<execution>

						<id>enforce-maven</id>

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

						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.3</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.0</version>

				<configuration>

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

				</configuration>

			</plugin>

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

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.1.1</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}+${maven.build.timestamp}</Implementation-Version>
						</manifestEntries>

					</archive>

				</configuration>

				<executions>
					<execution>

						<id>package-test-jar</id>
						<phase>package</phase>

						<goals>
							<goal>test-jar</goal>
						</goals>

					</execution>
				</executions>

			</plugin>

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

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

			</plugin>

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

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

				<configuration>

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

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

					<links>

						<link>http://docs.rdf4j.org/javadoc/latest/</link>

					</links>

				</configuration>

				<executions>

					<execution>

						<id>generate-aggregate-javadocs</id>
						<inherited>false</inherited>
						<phase>site</phase>

						<goals>
							<goal>aggregate</goal>
						</goals>

						<configuration>

							<reportOutputDirectory>${project.basedir}/docs/javadocs</reportOutputDirectory>
							<destDir>javadocs</destDir>

							<groups>
								<group>
									<title>Server Adapters</title>
									<packages>com.metreeca.j2ee*</packages>
								</group>
								<group>
									<title>REST API Framework</title>
									<packages>com.metreeca.rest*</packages>
								</group>
								<group>
									<title>REST IAM Framework</title>
									<packages>com.metreeca.gate*</packages>
								</group>
								<group>
									<title>Shapes Framework</title>
									<packages>com.metreeca.form*</packages>
								</group>
								<group>
									<title>Tooling Framework</title>
									<packages>com.metreeca.tray*</packages>
								</group>
								<group>
									<title>Tooling Kits</title>
									<packages>com.metreeca.kits*</packages>
								</group>
							</groups>

							<excludePackageNames/> <!-- colon-separated patterns -->

						</configuration>

					</execution>

				</executions>

			</plugin>


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

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.7.1</version>

				<configuration>

					<skipDeploy>true</skipDeploy> <!-- ;( manual deployment -->

					<stagingDirectory>${maven.multiModuleProjectDirectory}/docs/reports</stagingDirectory>

				</configuration>

			</plugin>

		</plugins>

	</build>

	<reporting>
		<plugins>

			<plugin> <!-- https://maven.apache.org/plugins/maven-project-info-reports-plugin/ -->

				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>3.0.0</version>

				<reportSets>

					<reportSet>

						<reports>
							<report>index</report>
							<report>dependencies</report>
						</reports>

						<configuration>
							<dependencyDetailsEnabled>false</dependencyDetailsEnabled>
						</configuration>

					</reportSet>

				</reportSets>

			</plugin>

		</plugins>
	</reporting>

	<profiles>
		<profile>

			<id>release</id>

			<build>
				<plugins>

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

						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.0.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>

						<executions>

							<execution>

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

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

							</execution>

						</executions>

					</plugin>

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

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

						<configuration>
							<executable>gpg2</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>
