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

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Copyright © 2019-2020 Metreeca srl

  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
   file except in compliance with the License. You may obtain a copy of the License at

           http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software distributed under the License is
  distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and limitations under the License.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->

<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>mark-maven-plugin</artifactId>
	<version>0.4.0</version>
	<packaging>maven-plugin</packaging>

	<name>Metreeca Static Site Generator</name>
	<description>A minimalist static site generator.</description>
	<url>https://github.com/metreeca/mark</url>
	<inceptionYear>2019</inceptionYear>

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

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license</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/mark.git</connection>
		<developerConnection>scm:git:git@github.com:metreeca/mark.git</developerConnection>
		<url>https://github.com/metreeca/mark</url>
	</scm>

	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/metreeca/mark/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>1.8</java.version>
		<maven.version>3.6</maven.version>

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

		<maven.deploy.skip>true</maven.deploy.skip> <!-- ossrh public artifact deployment -->

	</properties>

	<prerequisites>
		<maven>3.3</maven>
	</prerequisites>

	<dependencies>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-project</artifactId>
			<version>2.0.3</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-plugin-api</artifactId>
			<version>3.6.3</version>
		</dependency>

		<dependency>
			<groupId>org.apache.maven.plugin-tools</groupId>
			<artifactId>maven-plugin-annotations</artifactId>
			<version>3.6.0</version>
			<scope>provided</scope>
		</dependency>


		<dependency>
			<groupId>com.vladsch.flexmark</groupId>
			<artifactId>flexmark-all</artifactId>
			<version>0.62.2</version>
		</dependency>

		<dependency> <!-- https://github.com/neuland/pug4j -->
			<groupId>de.neuland-bfi</groupId>
			<artifactId>pug4j</artifactId>
			<version>2.0.0-alpha-2</version>
		</dependency>

		<dependency> <!-- https://github.com/i-net-software/jlessc -->
			<groupId>de.inetsoftware</groupId>
			<artifactId>jlessc</artifactId>
			<version>1.10</version>
		</dependency>

		<dependency> <!-- TagSoup SAX HTML Parser -->
			<groupId>org.ccil.cowan.tagsoup</groupId>
			<artifactId>tagsoup</artifactId>
			<version>1.2.1</version>
		</dependency>


		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>5.7.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.17.2</version>
			<scope>test</scope>
		</dependency>

	</dependencies>

	<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-M2</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/plugin-tools/maven-plugin-plugin/ -->

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

				<configuration>
					<goalPrefix>mark</goalPrefix>
				</configuration>

				<executions>

					<execution>

						<id>default-descriptor</id>
						<phase>process-classes</phase>

						<goals>
							<goal>descriptor</goal>
						</goals>

					</execution>

					<execution>

						<id>help-descriptor</id>
						<phase>process-classes</phase>

						<goals>
							<goal>helpmojo</goal>
						</goals>

					</execution>

				</executions>

			</plugin>

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

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

				<executions>
					<execution>

						<id>copy-std-themes</id>
						<phase>generate-resources</phase>

						<goals>
							<goal>copy-resources</goal>
						</goals>

						<configuration>

							<outputDirectory>${project.build.outputDirectory}/@/</outputDirectory>
							<overwrite>true</overwrite>

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

						</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/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/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-site-plugin -->

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

				<configuration>

					<skipDeploy>true</skipDeploy> <!-- github deployment -->

					<stagingDirectory>${project.build.directory}/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.1.1</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.2.0</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.2.0</version>

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