<?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-contract-tools</artifactId>
		<version>2.1.0.RELEASE</version>
		<relativePath>..</relativePath>
	</parent>

	<artifactId>spring-cloud-contract-gradle-plugin</artifactId>
	<packaging>pom</packaging>

	<name>Spring Cloud Contract Gradle Plugin</name>
	<description>Spring Cloud Contract Gradle Plugin</description>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-contract-verifier</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-contract-converters</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-contract-stub-runner</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<failIfNoTests>false</failIfNoTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-clean-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<filesets>
						<fileset>
							<directory>build</directory>
						</fileset>
						<fileset>
							<directory>target</directory>
						</fileset>
					</filesets>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.12</version>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>build/libs/${project.artifactId}-${project.version}.jar</file>
									<type>jar</type>
								</artifact>
								<artifact>
									<file>build/libs/${project.artifactId}-${project.version}-groovydoc.jar</file>
									<type>jar</type>
									<classifier>groovydoc</classifier>
								</artifact>
								<artifact>
									<file>build/libs/${project.artifactId}-${project.version}-javadoc.jar</file>
									<type>jar</type>
									<classifier>javadoc</classifier>
								</artifact>
								<artifact>
									<file>build/libs/${project.artifactId}-${project.version}-sources.jar</file>
									<type>jar</type>
									<classifier>sources</classifier>
								</artifact>
							</artifacts>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>default</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.6.0</version>
						<executions>
							<execution>
								<id>gradle</id>
								<phase>package</phase>
								<configuration>
									<executable>./gradlew</executable>
									<arguments>
										<argument>build</argument>
										<!--<argument>jacocoTestReport</argument>-->
										<argument>-PverifierVersion=${project.version}</argument>
									</arguments>
								</configuration>
								<goals>
									<goal>exec</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>windows</id>
			<activation>
				<os>
					<name>windows</name>
				</os>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.6.0</version>
						<executions>
							<execution>
								<id>gradle</id>
								<phase>package</phase>
								<configuration>
									<executable>gradlew.bat</executable>
									<arguments>
										<argument>build</argument>
										<!--<argument>jacocoTestReport</argument>-->
										<argument>-PverifierVersion=${project.version}</argument>
									</arguments>
								</configuration>
								<goals>
									<goal>exec</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>fast</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.6.0</version>
						<executions>
							<execution>
								<id>gradle</id>
								<phase>package</phase>
								<configuration>
									<executable>./gradlew</executable>
									<arguments>
										<argument>build</argument>
										<!--<argument>jacocoTestReport</argument>-->
										<argument>-Pfast</argument>
										<argument>-PverifierVersion=${project.version}</argument>
									</arguments>
								</configuration>
								<goals>
									<goal>exec</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>central</id>
			<activation>
				<activeByDefault>false</activeByDefault>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>exec-maven-plugin</artifactId>
						<version>1.6.0</version>
						<executions>
							<execution>
								<id>gradle</id>
								<phase>package</phase>
								<configuration>
									<executable>./gradlew</executable>
									<arguments>
										<argument>clean</argument>
										<argument>build</argument>
										<argument>-PverifierVersion=${project.version}</argument>
									</arguments>
								</configuration>
								<goals>
									<goal>exec</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
