<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
		 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>spring-cloud-docs</artifactId>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-build</artifactId>
		<version>2023.0.0-SNAPSHOT</version>
	</parent>
	<packaging>jar</packaging>
	<name>Spring Cloud Release Train Docs</name>
	<description>Spring Cloud Release Train Docs</description>
	<properties>
		<docs.main>spring-cloud</docs.main>
		<main.basedir>${basedir}/..</main.basedir>
		<upload-docs-zip.phase>deploy</upload-docs-zip.phase>

		<maven.version>3.8.5</maven.version>
		<handlebars.version>4.3.0</handlebars.version>
		<asciidoctorj.version>2.5.3</asciidoctorj.version>
		<commons-io.version>2.11.0</commons-io.version>

		<maven-gpg-plugin.phase>none</maven-gpg-plugin.phase>
		<maven-deploy-plugin-default.phase>none</maven-deploy-plugin-default.phase>
	</properties>
	<dependencies>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.maven</groupId>
			<artifactId>maven-model</artifactId>
			<version>${maven.version}</version>
		</dependency>
		<dependency>
			<groupId>com.github.jknack</groupId>
			<artifactId>handlebars</artifactId>
			<version>${handlebars.version}</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons-io.version}</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
			<id>docs</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<configuration>
							<systemProperties>
								<bomPath>${maven.multiModuleProjectDirectory}/spring-cloud-dependencies/pom.xml</bomPath>
								<starterParentPath>${maven.multiModuleProjectDirectory}/spring-cloud-starter-parent/pom.xml</starterParentPath>
								<repoUrl>${maven-deploy-plugin.deployZipUrl}</repoUrl>
								<unzippedDocs>${project.build.directory}/unpacked-docs/</unzippedDocs>
								<generatedTrainDocs>${project.build.directory}/train-docs/</generatedTrainDocs>
							</systemProperties>
						</configuration>
					</plugin>
					<plugin>
						<groupId>pl.project13.maven</groupId>
						<artifactId>git-commit-id-plugin</artifactId>
					</plugin>
					<plugin>
						<artifactId>maven-dependency-plugin</artifactId>
					</plugin>
					<plugin>
						<artifactId>maven-resources-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>run-template-generation</id>
								<phase>prepare-package</phase>
								<goals>
									<goal>java</goal>
								</goals>
								<configuration>
									<includePluginDependencies>true</includePluginDependencies>
									<mainClass>org.springframework.cloud.internal.GenerateReleaseTrainDocs</mainClass>
									<arguments>
										<argument>${maven.multiModuleProjectDirectory}/spring-cloud-dependencies/pom.xml</argument>
										<argument>${maven.multiModuleProjectDirectory}/spring-cloud-starter-parent/pom.xml</argument>
										<argument>https://github.com/spring-cloud/</argument>
										<argument>${project.build.directory}/unpacked-docs/</argument>
										<argument>${project.build.directory}/train-docs/</argument>
									</arguments>
								</configuration>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
						<configuration>
							<sourceDirectory>${project.build.directory}/train-docs/</sourceDirectory>
							<attributes>
								<basedir>${project.build.directory}/unpacked-docs</basedir>
								<releaseTrain>true</releaseTrain>
							</attributes>
						</configuration>
					</plugin>
					<plugin>
						<artifactId>maven-antrun-plugin</artifactId>
					</plugin>
					<plugin>
						<artifactId>maven-deploy-plugin</artifactId>
						<goals>
							<goal>deploy-file</goal>
						</goals>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
