<!--
  ~ This is part of Geomajas, a GIS framework, http://www.geomajas.org/.
  ~
  ~ Copyright 2008-2014 Geosparc nv, http://www.geosparc.com/, Belgium.
  ~
  ~ The program is available in open source according to the GNU Affero
  ~ General Public License. All contributions in this program are covered
  ~ by the Geomajas Contributors License Agreement. For full licensing
  ~ details, see LICENSE.txt in the project root.
  -->

<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>
	<packaging>pom</packaging>

	<parent>
		<groupId>org.geomajas.project</groupId>
		<artifactId>geomajas-parents</artifactId>
		<version>2.3.2</version>
	</parent>

	<groupId>org.geomajas</groupId>
	<artifactId>geomajas-doc-parent</artifactId>

	<name>Geomajas documentation parent</name>
	<description>
		Geomajas is a component framework for building rich Internet applications (RIA) with sophisticated capabilities
		for the display, analysis and management of geographic information. It is a building block that allows
		developers to add maps and other geographic data capabilities to their web applications.
	</description>

	<developers>
		<developer>
			<id>jandm</id>
			<name>Jan De Moerloose</name>
			<email>jan.demoerloose@geosparc.com</email>
			<roles>
				<role>Module maintainer</role>
			</roles>
		</developer>
	</developers>

	<profiles>
		<profile>
			<id>documentation</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>1.5</version>
						<executions>
							<execution>
								<id>add-resource</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>add-resource</goal>
								</goals>
								<configuration>
									<resources>
										<resource>
											<filtering>false</filtering>
											<directory>${project.build.directory}/docbkx/</directory>
											<excludes>
												<exclude>**/*.fo</exclude>
												<exclude>html/META-INF/**</exclude>
											</excludes>
										</resource>
									</resources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>2.1</version>
						<executions>
							<execution>
								<id>explode-style</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>unpack</goal>
								</goals>
								<configuration>
									<artifactItems>
										<artifactItem>
											<groupId>org.geomajas.documentation</groupId>
											<artifactId>geomajas-jdocbook-style</artifactId>
											<outputDirectory>${project.build.directory}/docbkx/html</outputDirectory>
										</artifactItem>
									</artifactItems>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.geomajas</groupId>
						<artifactId>geomajas-maven-plugin</artifactId>
						<version>2.3.0</version>
						<executions>
							<execution>
								<id>extract-listings-plugin</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>extract</goal>
								</goals>
								<configuration>
									<sourceDirectory>${listing.sourceDirectory}</sourceDirectory>
									<destinationDirectory>${basedir}/src/docbkx/listing</destinationDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<executions>
							<execution>
								<id>remove-listing</id>
								<phase>clean</phase>
								<configuration>
									<tasks>
										<delete dir="src/docbkx/listing" />
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
							<execution>
								<id>copy-resources</id>
								<phase>generate-sources</phase>
								<configuration>
									<tasks>
										<copy todir="${project.build.directory}/docbkx/html" failonerror="false">
											<fileset dir="${basedir}/src/docbkx">
												<exclude name="**/*.xml" />
											</fileset>
										</copy>
									</tasks>
								</configuration>
								<goals>
									<goal>run</goal>
								</goals>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>com.agilejava.docbkx</groupId>
						<artifactId>docbkx-maven-plugin</artifactId>
						<version>2.0.15</version>
						<dependencies>
							<dependency>
								<groupId>org.docbook</groupId>
								<artifactId>docbook-xml</artifactId>
								<version>4.4</version>
								<scope>runtime</scope>
							</dependency>
						</dependencies>

						<executions>
							<execution>
								<id>html-pdf</id>
								<phase>generate-sources</phase>
								<goals>
									<goal>generate-pdf</goal>
									<goal>generate-html</goal>
								</goals>
								<configuration>
									<!-- per execution configuration -->
									<includes>master.xml</includes>
									<htmlStylesheet>css/geomajas.css</htmlStylesheet>
									<sectionAutolabel>1</sectionAutolabel>
								</configuration>
							</execution>
						</executions>
						<configuration>
							<!-- shared configuration -->
							<xincludeSupported>true</xincludeSupported>
							<paperType>A4</paperType>
							<fop1Extensions>1</fop1Extensions>

							<highlightSource>1</highlightSource>
							<foCustomization>${project.build.directory}/docbkx/html/docbkx/docbook-fo.xsl</foCustomization>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- avoids eclipse build -->
		<profile>
			<id>m2e</id>
			<activation>
				<property>
					<name>m2e.version</name>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.eclipse.m2e</groupId>
						<artifactId>lifecycle-mapping</artifactId>
						<version>1.0.0</version>
						<configuration>
							<mappingId>customizable</mappingId>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	
	<!--  may be overridden by child poms -->
	<properties>
		<listing.sourceDirectory>${basedir}</listing.sourceDirectory>
	</properties>
	
</project>
