<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<artifactId>stream-applications-docs</artifactId>
	<name>stream-applications-docs</name>
	<description>Stream Apps Docs</description>
	<parent>
		<groupId>org.springframework.cloud.stream.app</groupId>
		<artifactId>stream-applications-release-train</artifactId>
		<version>${revision}</version>
	</parent>

	<properties>
		<docs.resources.version>0.2.1.RELEASE</docs.resources.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>io.spring.docresources</groupId>
			<artifactId>spring-doc-resources</artifactId>
			<version>${docs.resources.version}</version>
			<type>zip</type>
			<optional>true</optional>
		</dependency>
		<!-- Any modules whose javadocs need to be published must be listed here.
		Modules with @ConfigurationProperties.
		-->
		<!-- common javadocs -->
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>cdc-debezium-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>file-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>ftp-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>geode-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>metadata-store-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>mqtt-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>tcp-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>twitter-common</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<!-- supplier javadocs -->
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>cdc-debezium-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>file-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>ftp-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>geode-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>http-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>jdbc-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>jms-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>mail-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>mongodb-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>mqtt-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>rabbit-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>s3-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>sftp-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>syslog-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>tcp-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>time-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>twitter-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>websocket-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>zeromq-supplier</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<!-- consumer javadocs -->
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>cassandra-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>analytics-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>wavefront-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>elasticsearch-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>file-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>ftp-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>geode-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>jdbc-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>log-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>mongodb-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>mqtt-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>rabbit-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>redis-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>rsocket-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>s3-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>sftp-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>tcp-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>twitter-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>websocket-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>zeromq-consumer</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<!-- function javadocs -->
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>aggregator-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>header-enricher-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>http-request-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>image-recognition-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>object-detection-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>spel-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>splitter-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>task-launch-request-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.fn</groupId>
			<artifactId>twitter-function</artifactId>
			<version>${java-functions.version}</version>
		</dependency>
		<!-- Apps don't use external functions as baseline, but contain @ConfigurationProperties -->
		<dependency>
			<groupId>org.springframework.cloud.stream.app</groupId>
			<artifactId>load-generator-source</artifactId>
			<version>${apps.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.stream.app</groupId>
			<artifactId>router-sink</artifactId>
			<version>${apps.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.stream.app</groupId>
			<artifactId>pgcopy-sink</artifactId>
			<version>${apps.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.stream.app</groupId>
			<artifactId>throughput-sink</artifactId>
			<version>${apps.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.stream.app</groupId>
			<artifactId>groovy-processor</artifactId>
			<version>${apps.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud.stream.app</groupId>
			<artifactId>script-processor</artifactId>
			<version>${apps.version}</version>
		</dependency>

	</dependencies>
	<profiles>
		<profile>
			<id>full</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
								<phase>prepare-package</phase>
								<configuration>
									<includeDependencySources>true</includeDependencySources>
									<dependencySourceIncludes>
										<dependencySourceInclude>org.springframework.cloud.fn:*</dependencySourceInclude>
									</dependencySourceIncludes>
									<attach>false</attach>
									<quiet>true</quiet>
									<stylesheetfile>${basedir}/src/main/javadoc/spring-javadoc.css</stylesheetfile>
									<links>
										<link>https://docs.spring.io/spring-framework/docs/${spring.version}/javadoc-api/</link>
										<link>https://docs.spring.io/spring-shell/docs/current/api/</link>
									</links>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<executions>
							<execution>
								<id>unpack-doc-resources</id>
								<goals>
									<goal>unpack-dependencies</goal>
								</goals>
								<phase>generate-resources</phase>
								<configuration>
									<includeGroupIds>io.spring.docresources</includeGroupIds>
									<includeArtifactIds>spring-doc-resources</includeArtifactIds>
									<includeTypes>zip</includeTypes>
									<excludeTransitive>true</excludeTransitive>
									<outputDirectory>${project.build.directory}/refdocs/</outputDirectory>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<executions>
							<execution>
								<id>copy-asciidoc-resources</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<configuration>
									<outputDirectory>${project.build.directory}/refdocs/</outputDirectory>
									<resources>
										<resource>
											<directory>src/main/asciidoc</directory>
											<filtering>false</filtering>
										</resource>
									</resources>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
						<version>2.1.0</version>
						<dependencies>
							<dependency>
								<groupId>org.asciidoctor</groupId>
								<artifactId>asciidoctorj-pdf</artifactId>
								<version>1.5.3</version>
							</dependency>
						</dependencies>
						<executions>

							<execution>
								<id>html</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>process-asciidoc</goal>
								</goals>
								<configuration>
									<backend>html5</backend>
									<sourceHighlighter>highlight.js</sourceHighlighter>
									<outputDirectory>${project.build.directory}/contents/reference/html</outputDirectory>
									<sectids>false</sectids>
									<attributes>
										<project-version>${project.version}</project-version>
										<docinfo>shared</docinfo>
										<linkcss>true</linkcss>
										<icons>font</icons>
										<sectanchors>true</sectanchors>
										<stylesdir>css/</stylesdir>
										<stylesheet>spring.css</stylesheet>
										<highlightjsdir>js/highlight</highlightjsdir>
										<highlightjs-theme>github</highlightjs-theme>
									</attributes>
								</configuration>
							</execution>

							<execution>
								<id>pdf</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>process-asciidoc</goal>
								</goals>
								<configuration>
									<backend>pdf</backend>

									<outputDirectory>${project.build.directory}/contents/reference/pdf</outputDirectory>
									<sourceHighlighter>coderay</sourceHighlighter>
								</configuration>
							</execution>

						</executions>

						<configuration>
							<sourceDirectory>${project.build.directory}/refdocs/</sourceDirectory>
							<sourceDocumentName>index.adoc</sourceDocumentName>
							<doctype>book</doctype>
							<attributes>
								<version>${project.version}</version>
								<projectName>${project.name}</projectName>
								<projectVersion>${project.version}</projectVersion>
								<allow-uri-read>true</allow-uri-read>
								<toclevels>4</toclevels>
								<numbered>true</numbered>
								<baseDir>${project.basedir}</baseDir>
							</attributes>
						</configuration>
					</plugin>

					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.7</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" />
											<zipfileset dir="${project.build.directory}/contents/reference/html" prefix="reference/html" />
											<zipfileset dir="${project.build.directory}/contents/reference/pdf" prefix="reference/pdf" includes="index.pdf"/>
										</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="spring-boot-repo">
											<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>
