<?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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-dataflow-parent</artifactId>
		<version>1.4.1.RELEASE</version>
	</parent>
	<artifactId>spring-cloud-dataflow-docs</artifactId>
	<name>Spring Cloud Data Flow Docs</name>
	<description>Spring Cloud Data Flow Docs</description>
	<properties>
		<main.basedir>${basedir}/..</main.basedir>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-configuration-metadata</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-registry</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-rest-resource</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-server-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-server-local</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-rest-client</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-shell-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dataflow-completion</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-dataflow-server-local</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-dataflow-server-local</artifactId>
			<version>1.4.1.RELEASE</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.restdocs</groupId>
			<artifactId>spring-restdocs-mockmvc</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.restdocs</groupId>
			<artifactId>spring-restdocs-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-task-batch</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
			<id>full</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<includes>
								<include>**/*Documentation.java</include>
								<include>**/*Tests.java</include>
							</includes>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>2.10.1</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
								<phase>prepare-package</phase>
								<configuration>
									<includeDependencySources>true</includeDependencySources>
									<dependencySourceIncludes>
										<dependencySourceInclude>${project.groupId}:*</dependencySourceInclude>
									</dependencySourceIncludes>
									<attach>false</attach>
									<quiet>true</quiet>
									<stylesheetfile>${basedir}/src/main/javadoc/spring-javadoc.css</stylesheetfile>
									<links>
										<link>
											http://docs.spring.io/spring-framework/docs/${spring-framework.version}/javadoc-api/
										</link>
										<link>http://docs.spring.io/spring-shell/docs/current/api/</link>
									</links>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
						<version>1.5.3</version>
						<dependencies>
							<dependency>
								<groupId>org.asciidoctor</groupId>
								<artifactId>asciidoctorj-pdf</artifactId>
								<version>1.5.0-alpha.11</version>
							</dependency>
						</dependencies>
						<configuration>
							<sourceDocumentName>index.adoc</sourceDocumentName>
							<doctype>book</doctype>
							<attributes>
								<allow-uri-read>true</allow-uri-read>
								<attribute-missing>warn</attribute-missing>
								<project-version>${project.version}</project-version>
								<project-artifactId>${project.artifactId}</project-artifactId>
								<version-type-lowercase>${version-type-lowercase}</version-type-lowercase>
								<snippets>${basedir}/target/generated-snippets</snippets>
								<skipper-version>${spring-cloud-skipper.version}</skipper-version>
								<skipper-version-type-lowercase>${skipper-version-type-lowercase}</skipper-version-type-lowercase>
								<skipper-branch-or-tag>${skipper-branch-or-tag}</skipper-branch-or-tag>
								<github-tag>${github-tag}</github-tag>
							</attributes>
						</configuration>
						<executions>
							<execution>
								<id>generate-html5</id>
								<phase>prepare-package</phase>
								<goals>
									<goal>process-asciidoc</goal>
								</goals>
								<configuration>
									<backend>html5</backend>
									<attributes>
										<toc2 />
									</attributes>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>com.agilejava.docbkx</groupId>
						<artifactId>docbkx-maven-plugin</artifactId>
						<version>2.0.15</version>
						<configuration>
							<sourceDirectory>${basedir}/target/generated-docs</sourceDirectory>
							<imgSrcPath />
							<graphicsize.extension>0</graphicsize.extension>
							<includes>index.xml</includes>
							<xincludeSupported>true</xincludeSupported>
							<chunkedOutput>false</chunkedOutput>
							<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl</foCustomization>
							<useExtensions>1</useExtensions>
							<admonGraphics>1</admonGraphics>

							<highlightSource>1</highlightSource>
							<highlightXslthlConfig>${basedir}/src/main/docbook/xsl/xslthl-config.xml
							</highlightXslthlConfig>
							<preProcess>
								<copy todir="${basedir}/target/generated-docs/images">
									<fileset dir="${basedir}/src/main/docbook/images" />
								</copy>
							</preProcess>
						</configuration>
						<dependencies>
							<dependency>
								<groupId>net.sf.xslthl</groupId>
								<artifactId>xslthl</artifactId>
								<version>2.1.0</version>
							</dependency>
							<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>
						</dependencies>
						<executions>
							<execution>
								<id>html</id>
								<goals>
									<goal>generate-html</goal>
								</goals>
								<phase>prepare-package</phase>
								<configuration>
									<htmlCustomization>${basedir}/src/main/docbook/xsl/html-multipage.xsl
									</htmlCustomization>
									<targetDirectory>${basedir}/target/docbook/html</targetDirectory>
									<chunkedOutput>true</chunkedOutput>
									<postProcess>
										<copy todir="${basedir}/target/contents/reference/html">
											<fileset dir="${basedir}/target/docbook/html">
												<include name="**/*.html" />
											</fileset>
										</copy>
										<copy todir="${basedir}/target/contents/reference/html/images">
											<fileset dir="${basedir}/target/generated-docs/images" />
										</copy>
										<copy todir="${basedir}/target/contents/reference/html/css">
											<fileset dir="${basedir}/src/main/docbook/css" />
										</copy>
										<copy todir="${basedir}/target/generated-docs/tocbot-3.0.2">
											<fileset dir="${basedir}/src/main/asciidoc/tocbot-3.0.2" />
										</copy>
									</postProcess>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.8</version>
						<dependencies>
							<dependency>
								<groupId>ant-contrib</groupId>
								<artifactId>ant-contrib</artifactId>
								<version>1.0b3</version>
								<exclusions>
									<exclusion>
										<groupId>ant</groupId>
										<artifactId>ant</artifactId>
									</exclusion>
								</exclusions>
							</dependency>
							<dependency>
								<groupId>org.apache.ant</groupId>
								<artifactId>ant-nodeps</artifactId>
								<version>1.8.1</version>
							</dependency>
							<dependency>
								<groupId>org.tigris.antelope</groupId>
								<artifactId>antelopetasks</artifactId>
								<version>3.2.10</version>
							</dependency>
						</dependencies>
						<executions>
							<execution>
								<id>package-and-attach-docs-zip</id>
								<phase>package</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<target>
										<zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.zip">
											<zipfileset src="${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar" prefix="api" />
											<fileset dir="${project.build.directory}/contents" />
											<zipfileset dir="${project.build.directory}/generated-docs" prefix="reference/htmlsingle">
												<include name="index.html" />
												<include name="images/**" />
												<include name="tocbot-3.0.2/**" />
											</zipfileset>
										</zip>
									</target>
								</configuration>
							</execution>
							<execution>
								<id>setup-maven-properties</id>
								<phase>validate</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<exportAntProperties>true</exportAntProperties>
									<target>
										<taskdef resource="net/sf/antcontrib/antcontrib.properties" />
										<taskdef name="stringutil" classname="ise.antelope.tasks.StringUtilTask" />

										<var name="version-type" value="${project.version}" />
										<propertyregex property="version-type" override="true" input="${version-type}" regexp=".*\.(.*)" replace="\1" />
										<propertyregex property="version-type" override="true" input="${version-type}" regexp="(M)\d+" replace="MILESTONE" />
										<propertyregex property="version-type" override="true" input="${version-type}" regexp="(RC)\d+" replace="MILESTONE" />
										<propertyregex property="version-type" override="true" input="${version-type}" regexp="BUILD-(.*)" replace="SNAPSHOT" />
										<stringutil string="${version-type}" property="version-type-lowercase">
											<lowercase />
										</stringutil>

										<var name="skipper-version-type" value="${spring-cloud-skipper.version}" />
										<propertyregex property="skipper-version-type" override="true" input="${skipper-version-type}" regexp=".*\.(.*)" replace="\1" />
										<propertyregex property="skipper-version-type" override="true" input="${skipper-version-type}" regexp="(M)\d+" replace="MILESTONE" />
										<propertyregex property="skipper-version-type" override="true" input="${skipper-version-type}" regexp="(RC)\d+" replace="MILESTONE" />
										<propertyregex property="skipper-version-type" override="true" input="${skipper-version-type}" regexp="BUILD-(.*)" replace="SNAPSHOT" />
										<stringutil string="${skipper-version-type}" property="skipper-version-type-lowercase">
											<lowercase />
										</stringutil>

										<var name="github-tag" value="v${project.version}" />
										<propertyregex property="github-tag" override="true" input="${github-tag}" regexp=".*SNAPSHOT" replace="master" />
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>build-helper-maven-plugin</artifactId>
						<version>1.9.1</version>
						<executions>
							<execution>
								<id>attach-zip</id>
								<goals>
									<goal>attach-artifact</goal>
								</goals>
								<configuration>
									<artifacts>
										<artifact>
											<file>
												${project.build.directory}/${project.artifactId}-${project.version}.zip
											</file>
											<type>zip;zip.type=docs;zip.deployed=false</type>
										</artifact>
									</artifacts>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
