<?xml version="1.0" encoding="UTF-8"?>
<!--
	Licensed to the Apache Software Foundation (ASF) under one
	or more contributor license agreements.  See the NOTICE file
	distributed with this work for additional information
	regarding copyright ownership.  The ASF licenses this file
	to you 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/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>
	<prerequisites>
		<maven>3</maven>
	</prerequisites>

	<parent>
		<groupId>org.apache.cayenne.docs</groupId>
		<artifactId>cayenne-docs-parent</artifactId>
		<version>3.2.M2-SNAPSHOT</version>
	</parent>
	
	<modules>
        <module>docbook-stylesheets</module>
		<module>cayenne-guide</module>
		<module>getting-started</module>
		<module>getting-started-rop</module>
		<module>upgrade-guide</module>
    </modules>

    <properties>
        <project.stylesheetdir>${project.parent.basedir}/docbook-stylesheets/target/classes</project.stylesheetdir>

        <!-- This property allows to only expose major version in the docs metadata to avoid confusing SEO -->
        <cayenne.version.major>3.2</cayenne.version.major>
    </properties>

	<artifactId>cayenne-docbook</artifactId>
	<packaging>pom</packaging>
	<name>Cayenne Docbook Documentation</name>
	
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.agilejava.docbkx</groupId>
					<artifactId>docbkx-maven-plugin</artifactId>
					<version>2.0.14</version>
					<dependencies>
						<dependency>
							<groupId>org.docbook</groupId>
							<artifactId>docbook-xml</artifactId>
							<version>4.4</version>
							<scope>runtime</scope>
						</dependency>
					</dependencies>
				</plugin>
			</plugins>
		</pluginManagement>
		
		
		<plugins>
			<plugin>
				<groupId>com.agilejava.docbkx</groupId>
				<artifactId>docbkx-maven-plugin</artifactId>
				<configuration>
					<xincludeSupported>true</xincludeSupported>
					<highlightSource>true</highlightSource>
					<targetDirectory>${basedir}/target/site/</targetDirectory>
					<includes>index.xml</includes>				
				</configuration>
				<executions>
					<execution>
						<id>build-pdf</id>
						<configuration>
							<foCustomization>${project.stylesheetdir}/stylesheets/pdf.xsl</foCustomization>
							<postProcess>
								<delete failonerror="false">
									<fileset dir="target/site/" includes="*.fo" />
								</delete>
								<move file="target/site/index.pdf" tofile="target/site/${project.artifactId}.pdf" />
							</postProcess>
						</configuration>
						<phase>generate-resources</phase>
						<goals>
							<goal>generate-pdf</goal>
						</goals>
					</execution>
					<execution>
						<id>build-html</id>
						<configuration>
							<htmlCustomization>${project.stylesheetdir}/stylesheets/html.xsl</htmlCustomization>
							<chunkedOutput>true</chunkedOutput>
							<postProcess>
								<copy todir="${basedir}/target/site/index/css">
									<fileset dir="${project.stylesheetdir}/css" />
								</copy>
								<copy todir="${basedir}/target/site/index/images">
									<fileset dir="${basedir}/src/images" />
								</copy>
							</postProcess>
						</configuration>
						<phase>generate-resources</phase>
						<goals>
							<goal>generate-html</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>