<?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/maven-v4_0_0.xsd">
	<properties>
		<packaging.type>pom</packaging.type>
        <guide_path>${myproject.basedir}/distribution-docs/Administration_Guide</guide_path>
		<guide_filename>index</guide_filename>
		<guide_name>Administration</guide_name>
        <skip-distribution-deploy>true</skip-distribution-deploy>
	</properties>
	<modelVersion>4.0.0</modelVersion>

	<artifactId>tigase-server-docs</artifactId>
	<name>Tigase XMPP Server Administration Guide</name>

	<packaging>pom</packaging>

	<parent>
		<groupId>tigase</groupId>
		<artifactId>tigase-server-master</artifactId>
		<version>8.0.0-SNAPSHOT</version>
	</parent>

	<modules>
		<module>devguide</module>
	</modules>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-resources-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<execution>
							<id>copy-resources</id>
							<!-- here the phase you need -->
							<phase>validate</phase>
							<goals>
								<goal>copy-resources</goal>
							</goals>
							<configuration>
								<outputDirectory>${basedir}/${guide_path}/html</outputDirectory>
								<resources>
									<resource>

										<directory>src/non-packaged-resources</directory>
										<filtering>true</filtering>
									</resource>
								</resources>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.asciidoctor</groupId>
					<artifactId>asciidoctor-maven-plugin</artifactId>
					<version>1.5.6</version>
					<executions>
						<execution>
							<id>output-html</id>
							<goals>
								<goal>process-asciidoc</goal>
							</goals>
							<configuration>
								<sourceHighlighter>coderay</sourceHighlighter>
								<backend>html5</backend>
								<preserveDirectories>true</preserveDirectories>
								<outputDirectory>${guide_path}/html</outputDirectory>
								<attributes>
									<toc>left</toc>
									<sectanchors>true</sectanchors>
									<linkcss>true</linkcss>
									<imagesdir>.</imagesdir>
								</attributes>
								<resources>
									<resource>
										<directory>target/text/components/http-api/documentation/images</directory>
										<targetPath>${guide_path}/html/images</targetPath>
									</resource>
									<resource>
										<directory>images</directory>
										<targetPath>${guide_path}/html/images</targetPath>
									</resource>
									<!--<resource>-->
										<!--<directory>target/text/components/muc/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/pubsub/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/push/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-push-apns/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-push-fcm/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-message-archiving/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-unified-archive/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-stun/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/socks5/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-spam/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
									<!--<resource>-->
										<!--<directory>target/text/components/tigase-extras/documentation/images</directory>-->
										<!--<targetPath>${guide_path}/html/images</targetPath>-->
									<!--</resource>-->
								</resources>
							</configuration>
						</execution>
						<execution>
							<id>output-docbook</id>
							<goals>
								<goal>process-asciidoc</goal>
							</goals>
							<configuration>
								<preserveDirectories>true</preserveDirectories>
								<outputDirectory>${project.build.directory}/docbook/</outputDirectory>
								<backend>docbook</backend>
								<doctype>book</doctype>
								<attributes>
									<linkcss>true</linkcss>
									<imagesdir>.</imagesdir>
								</attributes>
							</configuration>
						</execution>
					</executions>
					<configuration>
						<gemPath>gems-provided</gemPath>
						<sourceDirectory>./</sourceDirectory>
						<sourceDocumentName>index.asciidoc</sourceDocumentName>
						<attributes>
							<endpoint-url>http://docs.tigase.org</endpoint-url>
						</attributes>
						<headerFooter>true</headerFooter>
					</configuration>
				</plugin>

				<plugin>
					<groupId>com.agilejava.docbkx</groupId>
					<artifactId>docbkx-maven-plugin</artifactId>
					<version>2.0.16</version>
					<dependencies>
						<dependency>
							<groupId>net.sf.docbook</groupId>
							<artifactId>docbook-xml</artifactId>
							<version>5.0-all</version>
							<classifier>resources</classifier>
							<type>zip</type>
							<scope>runtime</scope>
						</dependency>
						<dependency>
							<groupId>net.sf.xslthl</groupId>
							<artifactId>xslthl</artifactId>
							<version>2.0.1</version>
							<scope>runtime</scope>
						</dependency>
						<dependency>
							<groupId>net.sf.offo</groupId>
							<artifactId>fop-hyph</artifactId>
							<version>1.2</version>
							<scope>runtime</scope>
						</dependency>
					</dependencies>
					<executions>
						<execution>
							<id>generate-pdf</id>
							<goals>
								<goal>generate-pdf</goal>
							</goals>
							<configuration>
								<targetDirectory>${guide_path}/pdf/</targetDirectory>
								<imgSrcPath>${project.build.directory}/docbook/</imgSrcPath>
								<ignoreImageScaling>true</ignoreImageScaling>
								<fopLogLevel>OFF</fopLogLevel>
								<!--<defaultImageWidth>3cm</defaultImageWidth>-->
								<!--<ignoreImageScaling>true</ignoreImageScaling>-->
								<postProcess>
									<move file="${guide_path}/pdf/index.pdf" tofile="${guide_path}/pdf/${guide_name}Guide.pdf" failonerror="false" />
								</postProcess>
							</configuration>
						</execution>
						<execution>
							<id>generate-html</id>
							<goals>
								<goal>generate-html</goal>
							</goals>
							<configuration>
								<chunkedOutput>true</chunkedOutput>
								<targetDirectory>${guide_path}/html_chunk/</targetDirectory>
								<targetsFilename>true</targetsFilename>
								<useIdAsFilename>true</useIdAsFilename>
								<cssDecoration>true</cssDecoration>
								<annotationCss>true</annotationCss>
								<htmlStylesheet>css/docbook-xsl.css</htmlStylesheet>
								<postProcess>
									<copy todir="${guide_path}/html_chunk/css">
										<fileset dir="css"/>
									</copy>
									<copy todir="${guide_path}/html_chunk/images">
										<fileset dir="images"/>
										<fileset dir="target/text/components/http-api/documentation/images"/>
									</copy>
									<copy todir="${guide_path}/html_chunk/files">
										<fileset dir="files"/>
									</copy>
								</postProcess>
							</configuration>
						</execution>
						<execution>
							<id>generate-epub3</id>
							<goals>
								<goal>generate-epub3</goal>
							</goals>
							<configuration>
								<targetDirectory>${project.build.directory}/epub3/</targetDirectory>
								<targetsFilename>true</targetsFilename>
								<useIdAsFilename>true</useIdAsFilename>
								<cssDecoration>true</cssDecoration>
								<annotationCss>true</annotationCss>
								<preProcess>
									<copy todir="${project.build.directory}/epub3/css">
										<fileset dir="css"/>
									</copy>
									<copy todir="${project.build.directory}/epub3/images">
										<fileset dir="images"/>
										<fileset dir="target/text/components/http-api/documentation/images"/>
									</copy>
									<copy todir="${project.build.directory}/epub3/files">
										<fileset dir="files"/>
									</copy>
								</preProcess>
								<postProcess>
									<move file="${project.build.directory}/index.epub"
												tofile="${guide_path}/epub/${guide_name}Guide.epub"
												failonerror="false" />
								</postProcess>
							</configuration>
						</execution>
					</executions>
					<configuration>
						<chunkedOutput>true</chunkedOutput>
						<sourceDirectory>${project.build.directory}/docbook/</sourceDirectory>
						<includes>${guide_filename}.xml</includes>
						<!--<imgSrcPath>../html/</imgSrcPath>-->
						<highlightSource>1</highlightSource>
						<!--<foCustomization>src/docbkx/docbook-fo.xsl</foCustomization>-->
						<hyphenate>true</hyphenate>
						<hyphenateVerbatim>true</hyphenateVerbatim>

					</configuration>
				</plugin>

				<plugin>
					<artifactId>maven-clean-plugin</artifactId>
					<version>3.0.0</version>
					<executions>
						<execution>
							<id>clean generated documentation</id>
							<phase>clean</phase>
							<goals>
								<goal>clean</goal>
							</goals>
							<configuration>
								<directory>${guide_path}</directory>
								<!--<verbose>true</verbose>-->
							</configuration>
						</execution>

					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
		<!-- Begin Dependency Extraction -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.8</version>
				<executions>
					<execution>
						<id>tigase-docs-resource</id>
						<phase>validate</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-http-api</artifactId>
									<version>2.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>true</overWrite>
									<outputDirectory>target/text/components/http-api</outputDirectory>
									<includes>**/*.asciidoc,**/*.css,**/*.jpg,**/*.png</includes>
								</artifactItem>

								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-muc</artifactId>
									<version>3.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>target/text/components/muc</outputDirectory>
									<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
										<groupId>tigase</groupId>
										<artifactId>tigase-pubsub</artifactId>
										<version>4.0.0-SNAPSHOT</version>
										<type>jar</type>
										<overWrite>false</overWrite>
										<outputDirectory>target/text/components/pubsub</outputDirectory>
										<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-message-archiving</artifactId>
									<version>2.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>target/text/components/tigase-message-archiving</outputDirectory>
									<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-unified-archive</artifactId>
									<version>2.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>target/text/components/tigase-unified-archive</outputDirectory>
									<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
										<groupId>tigase</groupId>
										<artifactId>tigase-push</artifactId>
										<version>1.0.0-SNAPSHOT</version>
										<type>jar</type>
										<overWrite>false</overWrite>
										<outputDirectory>target/text/components/tigase-push/</outputDirectory>
										<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
										<groupId>tigase</groupId>
										<artifactId>tigase-push-apns</artifactId>
										<version>1.0.0-SNAPSHOT</version>
										<type>jar</type>
										<overWrite>false</overWrite>
										<outputDirectory>target/text/target/components/tigase-push-apns/</outputDirectory>
										<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
										<groupId>tigase</groupId>
										<artifactId>tigase-push-fcm</artifactId>
										<version>1.0.0-SNAPSHOT</version>
										<type>jar</type>
										<overWrite>false</overWrite>
										<outputDirectory>target/text/target/components/tigase-push-fcm/</outputDirectory>
										<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
										<groupId>tigase</groupId>
										<artifactId>tigase-stun</artifactId>
										<version>2.0.0-SNAPSHOT</version>
										<type>jar</type>
										<overWrite>false</overWrite>
										<outputDirectory>target/text/components/tigase-stun/</outputDirectory>
										<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-socks5</artifactId>
									<version>2.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>target/text/components/socks5</outputDirectory>
									<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-spam</artifactId>
									<version>2.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>target/text/components/tigase-spam</outputDirectory>
									<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>
								
								<artifactItem>
									<groupId>tigase</groupId>
									<artifactId>tigase-extras-mdns</artifactId>
									<version>2.0.0-SNAPSHOT</version>
									<type>jar</type>
									<overWrite>false</overWrite>
									<outputDirectory>target/text/components/tigase-extras</outputDirectory>
									<includes>**/*.asciidoc,**/*.css</includes>
								</artifactItem>

							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.8.2</version>
				<configuration>
                    <skip>${skip-distribution-deploy}</skip>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.asciidoctor</groupId>
				<artifactId>asciidoctor-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>output-html</id>
						<phase>generate-resources</phase>
					</execution>
					<execution>
						<id>output-docbook</id>
						<phase>generate-resources</phase>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>com.agilejava.docbkx</groupId>
				<artifactId>docbkx-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>generate-pdf</id>
						<phase>generate-resources</phase>
					</execution>
					<execution>
						<id>generate-html</id>
						<phase>generate-resources</phase>
					</execution>
					<execution>
						<phase>generate-resources</phase>
						<id>generate-epub3</id>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-clean-plugin</artifactId>
				<version>2.6</version>
				<executions>
                    <execution>
                        <id>clean generated documentation</id>
                        <phase>clean</phase>
                    </execution>
                </executions>
			</plugin>
		</plugins>

	</build>

	<!-- Documentation Dependencies -->
	<dependencies>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-muc</artifactId>
			<version>3.0.0-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-pubsub</artifactId>
			<version>4.0.0-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-http-api</artifactId>
			<version>2.0.0-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-socks5</artifactId>
			<version>2.0.0-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>tigase</groupId>
			<artifactId>tigase-spam</artifactId>
			<version>2.0.0-SNAPSHOT</version>
		</dependency>
	</dependencies>




	<pluginRepositories>
		<pluginRepository>
			<id>sonatype.snapshots</id>
			<name>Maven Plugin Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
			<releases>
				<enabled>false</enabled>
			</releases>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
		</pluginRepository>
	</pluginRepositories>
</project>
