<?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>
	<artifactId>spring-cloud-build</artifactId>
	<packaging>pom</packaging>
	<name>Spring Cloud Build</name>
	<description>Spring Cloud Build</description>
	<url>http://projects.spring.io/spring-cloud/</url>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-parent</artifactId>
		<version>1.0.0.RELEASE</version>
	</parent>
	<organization>
		<name>Pivotal Software, Inc.</name>
		<url>http://www.spring.io</url>
	</organization>
	<licenses>
		<license>
			<name>Apache License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
		</license>
	</licenses>
	<scm>
		<url>https://github.com/spring-cloud/spring-cloud-build</url>
		<connection>scm:git:git://github.com/spring-cloud/spring-cloud-build.git</connection>
		<developerConnection>scm:git:ssh://git@github.com/spring-cloud/spring-cloud-build.git</developerConnection>
		<tag>HEAD</tag>
	</scm>
	<developers>
		<developer>
			<id>dsyer</id>
			<name>Dave Syer</name>
			<email>dsyer at pivotal.io</email>
			<organization>Pivotal Software, Inc.</organization>
			<organizationUrl>http://www.spring.io</organizationUrl>
			<roles>
				<role>Project lead</role>
			</roles>
		</developer>
		<developer>
			<id>sgibb</id>
			<name>Spencer Gibb</name>
			<email>sgibb at pivotal.io</email>
			<organization>Pivotal Software, Inc.</organization>
			<organizationUrl>http://www.spring.io</organizationUrl>
			<roles>
				<role>Project lead</role>
			</roles>
		</developer>
	</developers>
	<prerequisites>
		<maven>3.0.0</maven>
	</prerequisites>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>1.7</java.version>
		<main.basedir>${basedir}</main.basedir>
		<docs.main>${project.artifactId}</docs.main>
	</properties>
	<build>
		<plugins>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>javadoc</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<phase>package</phase>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
						<phase>package</phase>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-antrun-plugin</artifactId>
					<version>1.7</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.17</version>
				</plugin>
				<plugin>
					<groupId>com.google.code.maven-replacer-plugin</groupId>
					<artifactId>replacer</artifactId>
					<version>1.5.3</version>
				</plugin>
				<plugin>
					<groupId>org.asciidoctor</groupId>
					<artifactId>asciidoctor-maven-plugin</artifactId>
					<version>1.5.0</version>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	<distributionManagement>
		<downloadUrl>https://github.com/spring-cloud</downloadUrl>
		<site>
			<id>spring-docs</id>
			<url>scp://static.springframework.org/var/www/domains/springframework.org/static/htdocs/spring-cloud/docs/${project.artifactId}/${project.version}
		</url>
		</site>
		<repository>
			<id>repo.spring.io</id>
			<name>Spring Release Repository</name>
			<url>https://repo.spring.io/libs-release-local</url>
		</repository>
		<snapshotRepository>
			<id>repo.spring.io</id>
			<name>Spring Snapshot Repository</name>
			<url>https://repo.spring.io/libs-snapshot-local</url>
		</snapshotRepository>
	</distributionManagement>
	<profiles>
		<profile>
			<id>milestone</id>
			<distributionManagement>
				<repository>
					<id>repo.spring.io</id>
					<name>Spring Milestone Repository</name>
					<url>https://repo.spring.io/libs-milestone-local</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>central</id>
			<distributionManagement>
				<snapshotRepository>
					<id>sonatype-nexus-snapshots</id>
					<name>Sonatype Nexus Snapshots</name>
					<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
				</snapshotRepository>
				<repository>
					<id>sonatype-nexus-staging</id>
					<name>Nexus Release Repository</name>
					<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
			</distributionManagement>
		</profile>
		<profile>
			<id>java8</id>
			<activation>
				<jdk>[1.8,)</jdk>
			</activation>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-javadoc-plugin</artifactId>
						<configuration>
							<additionalparam>-Xdoclint:none</additionalparam>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>imports</id>
			<activation>
				<os>
					<family>!windows</family>
				</os>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>imports</id>
								<phase>process-sources</phase>
								<configuration>
									<executable>egrep</executable>
									<successCodes>
										<successCode>1</successCode>
									</successCodes>
									<arguments>
										<argument>-rm</argument>
										<argument>1</argument>
										<!-- Forbidden Keywords -->
										<argument>^import com.google</argument>
										<!-- file patterns -->
										<argument>--include=*.java</argument>
										<!-- search path -->
										<argument>.</argument>
									</arguments>
								</configuration>
								<goals>
									<goal>exec</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>java7</id>
			<activation>
				<file>
					<missing>.jdk8</missing>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>animal-sniffer-maven-plugin</artifactId>
						<version>1.13</version>
						<configuration>
							<signature>
								<groupId>org.codehaus.mojo.signature</groupId>
								<artifactId>java17</artifactId>
								<version>1.0</version>
							</signature>
						</configuration>
						<executions>
							<execution>
								<id>enforce-java-7</id>
								<phase>test</phase>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>docs</id>
			<build>
				<pluginManagement>
					<plugins>
						<plugin>
							<groupId>org.asciidoctor</groupId>
							<artifactId>asciidoctor-maven-plugin</artifactId>
							<executions>
								<execution>
									<id>generate-docs</id>
									<phase>process-resources</phase>
									<goals>
										<goal>process-asciidoc</goal>
									</goals>
									<configuration>
										<sourceDocumentName>${docs.main}.adoc</sourceDocumentName>
										<backend>html</backend>
										<doctype>article</doctype>
										<attributes>
											<docinfo>true</docinfo>
											<spring-cloud-version>${project.version}</spring-cloud-version>
										</attributes>
									</configuration>
								</execution>
							</executions>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-antrun-plugin</artifactId>
							<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>
								<dependency>
									<groupId>org.jruby</groupId>
									<artifactId>jruby-complete</artifactId>
									<version>1.7.12</version>
								</dependency>
							</dependencies>
							<executions>
								<execution>
									<id>readme</id>
									<phase>process-resources</phase>
									<goals>
										<goal>run</goal>
									</goals>
									<configuration>
										<tasks>
											<java classname="org.jruby.Main" failonerror="yes">
												<arg value="${basedir}/src/main/ruby/generate_readme.sh" />
												<arg value="-o" />
												<arg value="${main.basedir}/README.adoc" />
											</java>
										</tasks>
									</configuration>
								</execution>
								<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">
												<fileset dir="${project.build.directory}/generated-docs" />
											</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-cloud-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>
							<executions>
								<execution>
									<id>attach-zip</id>
									<goals>
										<goal>attach-artifact</goal>
									</goals>
									<configuration>
										<skipAttach>true</skipAttach>
										<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>
				</pluginManagement>
			</build>
		</profile>
	</profiles>
</project>
