<?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-build-docs</artifactId>
	<name>spring-cloud-build-docs</name>
	<packaging>jar</packaging>
	<description>Spring Cloud Build Docs</description>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-build</artifactId>
		<version>2.2.3.RELEASE</version>
	</parent>
	<properties>
		<docs.main>spring-cloud-build</docs.main>
		<!-- Comma separated list of whitelisted branches -->
		<docs.whitelisted.branches>1.2.x,1.3.x,2.0.x,2.1.x</docs.whitelisted.branches>
		<main.basedir>${basedir}/..</main.basedir>
		<gmavenplus-plugin.version>1.8.1</gmavenplus-plugin.version>
		<groovy.version>2.5.9</groovy.version>
		<!-- We don't want to downloaded sources of our own project-->
		<maven-dependency-plugin-for-docs.phase>none</maven-dependency-plugin-for-docs.phase>
		<docs.resources.dir>${project.basedir}/src/main/</docs.resources.dir>
	</properties>
	<dependencies>
		<!-- Script -->
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>1.2</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-xml</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-nio</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-json</artifactId>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-all</artifactId>
			<version>${groovy.version}</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<resources>
			<resource>
				<directory>src/main</directory>
				<excludes>
					<exclude>groovy/**/*.*</exclude>
				</excludes>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>${build-helper-maven-plugin.version}</version>
				<executions>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/main/groovy</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.gmavenplus</groupId>
				<artifactId>gmavenplus-plugin</artifactId>
				<version>${gmavenplus-plugin.version}</version>
				<executions>
					<execution>
						<goals>
							<goal>compile</goal>
							<goal>addSources</goal>
							<goal>generateStubs</goal>
							<goal>generateTestStubs</goal>
							<goal>groovydoc-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>2.8.2</version>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>docs</id>
			<build>
				<plugins>
					<plugin>
						<groupId>pl.project13.maven</groupId>
						<artifactId>git-commit-id-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>unix</id>
			<activation>
				<os>
					<family>unix</family>
					<name>Linux</name>
				</os>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>exec-maven-plugin</artifactId>
						<groupId>org.codehaus.mojo</groupId>
						<executions>
							<execution>
								<id>Run tests</id>
								<phase>test</phase>
								<goals>
									<goal>exec</goal>
								</goals>
								<configuration>
									<skip>${skipTests}</skip>
									<skip>true</skip>
									<executable>${basedir}/src/test/bash/run-bats.sh</executable>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
