<?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>
	<parent>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-kubernetes</artifactId>
		<version>3.1.6-SNAPSHOT</version>
	</parent>

	<artifactId>spring-cloud-kubernetes-integration-tests</artifactId>
	<packaging>pom</packaging>

	<name>Spring Cloud Kubernetes :: Integration Tests</name>
	<description>Integration tests where SCK applications are run inside a Kubernetes cluster</description>

	<build>
		<plugins>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<version>${maven-deploy-plugin.version}</version>
				<configuration>
					<skip>true</skip>
				</configuration>
			</plugin>

			<!-- build image in the 'package' phase, and ignore plain tests -->
			<!-- via maven-surefire-plugin::skipTests -->
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<imageName>docker.io/springcloud/${project.artifactId}:${project.version}</imageName>
				</configuration>
				<executions>
					<execution>
						<id>build-image</id>
						<phase>package</phase>
						<goals>
							<goal>build-image-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- ignore plain tests (in the 'test' phase), so that we could build the image first, see above -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<skipTests>true</skipTests>
				</configuration>
			</plugin>

			<!-- run tests in the 'integration-tests' phase, one that is after 'package' (where we build the image) -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<classesDirectory>${project.build.outputDirectory}</classesDirectory>
					<includes>
						<include>${testsToRun}</include>
					</includes>
				</configuration>
			</plugin>

		</plugins>

	</build>

	<modules>

		<!-- catalog-watcher -->
		<module>spring-cloud-kubernetes-fabric8-client-catalog-watcher</module>
		<module>spring-cloud-kubernetes-k8s-client-catalog-watcher</module>

		<!-- discovery client -->
		<module>spring-cloud-kubernetes-fabric8-client-discovery</module>
		<module>spring-cloud-kubernetes-k8s-client-discovery</module>

		<!-- reload via plain reload/paths/configtree and catalog watcher -->
		<module>spring-cloud-kubernetes-fabric8-client-reload</module>
		<module>spring-cloud-kubernetes-k8s-client-reload</module>

		<!-- at the moment there is no k8s native client support for istio -->
		<module>spring-cloud-kubernetes-fabric8-client-istio</module>

		<!-- discovery using discovery server -->
		<!-- since discovery controller is based on k8s-client, we do not have a fabric8 module -->
		<module>spring-cloud-kubernetes-k8s-client-discovery-server</module>

		<!-- configuration watcher is based on k8s-client, there's no fabric8 counterpart -->
		<module>spring-cloud-kubernetes-k8s-client-configuration-watcher</module>

		<!-- config watcher reload, using kafka and configmap -->
        <module>spring-cloud-kubernetes-k8s-client-kafka-configmap-reload</module>

		<!-- config watcher reload, using rabbitmq and secret -->
        <module>spring-cloud-kubernetes-k8s-client-rabbitmq-secret-reload</module>

	</modules>
</project>
