<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright The WildFly Authors
  ~ SPDX-License-Identifier: Apache-2.0
  -->
<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>

	<parent>
		<groupId>org.jboss</groupId>
		<artifactId>jboss-parent</artifactId>
		<version>51</version>
		<!--
        Maintain separation between the artifact id and the version to help prevent
        merge conflicts between commits changing the GA and those changing the V.
        -->
		<relativePath/>
	</parent>

	<groupId>org.wildfly</groupId>
	<artifactId>wildfly-application-development-guide</artifactId>
	<version>1.0.0.Final</version>
	<packaging>pom</packaging>

	<name>WildFly Application Development Guide</name>
	<description>WildFly application development guide using Asciidoctor Maven plugin.</description>
	<url>https://github.com/wildfly/wildfly-application-development-book</url>

	<licenses>
		<license>
			<name>Apache License 2.0</name>
			<url>http://repository.jboss.org/licenses/apache-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>theashiot</id>
			<name>Ashwin Mehendale</name>
			<url>https://github.com/theashiot</url>
		</developer>
		<developer>
			<id>emmartins</id>
			<name>Eduardo Martins</name>
			<url>https://github.com/emmartins</url>
		</developer>
		<developer>
			<id>wildfly.org</id>
			<name>WildFly Community</name>
			<organization>wildfly.org</organization>
			<organizationUrl>http://wildfly.org</organizationUrl>
		</developer>
	</developers>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<!-- the Maven project should use the minimum Java SE version supported -->
		<maven.compiler.release>17</maven.compiler.release>
		<asciidoctor.maven.plugin.version>3.0.0</asciidoctor.maven.plugin.version>
		<asciidoctorj.version>2.5.13</asciidoctorj.version>
		<jruby.version>9.4.6.0</jruby.version>
		<server.version>38.0.0.Final</server.version>
		<plugin.version>5.1.1.Final</plugin.version>
		<!-- Repository Deployment Settings -->
		<nexus.repository.staging>wildfly-staging</nexus.repository.staging>
		<nexus.staging.tag>wildfly-application-development-book-${project.version}</nexus.staging.tag>
	</properties>

	<scm>
		<connection>scm:git:git@github.com:wildfly/wildfly-application-development-book.git</connection>
		<developerConnection>scm:git:git@github.com:wildfly/wildfly-application-development-book.git</developerConnection>
		<url>https://github.com/wildfly/wildfly-application-development-book</url>
	</scm>

	<build>
		<plugins>
			<!-- builds a zip with the doc sources -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<executions>
					<execution>
						<id>distribution</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<inlineDescriptors>
								<inlineDescriptor>
									<id>sources</id>
									<includeBaseDirectory>false</includeBaseDirectory>
									<formats>
										<format>zip</format>
									</formats>
									<fileSets>
										<fileSet>
											<directory>${project.basedir}/src/docs/asciidoc</directory>
											<outputDirectory>.</outputDirectory>
										</fileSet>
									</fileSets>
								</inlineDescriptor>
							</inlineDescriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- builds the doc as html -->
			<plugin>
				<groupId>org.asciidoctor</groupId>
				<artifactId>asciidoctor-maven-plugin</artifactId>
				<version>${asciidoctor.maven.plugin.version}</version>
				<dependencies>
					<!-- Comment this section to use the default jruby artifact
					provided by the plugin -->
					<dependency>
						<groupId>org.jruby</groupId>
						<artifactId>jruby</artifactId>
						<version>${jruby.version}</version>
					</dependency>
					<!-- Comment this section to use the default AsciidoctorJ
					artifact provided by the plugin -->
					<dependency>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctorj</artifactId>
						<version>${asciidoctorj.version}</version>
					</dependency>
				</dependencies>
				<configuration>
					<!-- Attributes common to all output formats, and versions to be injected -->
					<attributes>
						<server-version>${server.version}</server-version>
						<plugin-version>${plugin.version}</plugin-version>
					</attributes>
				</configuration>
				<executions>
					<execution>
						<id>asciidoc-to-html</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>process-asciidoc</goal>
						</goals>
						<configuration>
							<backend>html5</backend>
							<attributes>
								<source-highlighter>rouge</source-highlighter>
								<imagesdir>./images</imagesdir>
								<toc>left</toc>
								<icons>font</icons>
								<sectanchors>true</sectanchors>
								<!-- set the idprefix to blank -->
								<idprefix />
								<idseparator>-</idseparator>
								<docinfo1>true</docinfo1>
							</attributes>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>