<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>marketing.heyday.hartmann.fotodocumentation</groupId>
		<artifactId>hartmann-foto-documentation</artifactId>
		<version>1.0.1</version>
		<relativePath>../hartmann-foto-documentation/pom.xml</relativePath>
	</parent>
	<artifactId>hartmann-foto-documentation-docker</artifactId>
	<version>1.0.0-SNAPSHOT</version>
	<name>hartmann-foto-documentation docker</name>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<configuration>
					<skip>true</skip>
					<skipDeploy>true</skipDeploy>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.0.0-M1</version>
				<configuration>
					<skipTests>true</skipTests>
					<testFailureIgnore>true</testFailureIgnore>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<properties>
		<sonar.java.libraries>${project.build.directory}/lib/*.jar</sonar.java.libraries>
		<sonar.libraries>${project.build.directory}/lib/*.jar</sonar.libraries>
	</properties>
	<profiles>
		<profile>
			<id>docker</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-site-plugin</artifactId>
						<version>3.1</version>
						<configuration>
							<skip>true</skip>
							<skipDeploy>true</skipDeploy>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-surefire-plugin</artifactId>
						<version>3.0.0-M1</version>
						<configuration>
							<skip>true</skip>
							<skipTests>true</skipTests>
							<testFailureIgnore>true</testFailureIgnore>
						</configuration>
						<executions>
							<execution>
								<id>integration-test</id>
								<goals>
									<goal>test</goal>
								</goals>
								<phase>integration-test</phase>
								<configuration>
									<skip>false</skip>
									<skipTests>false</skipTests>
									<argLine />
									<forkMode>once</forkMode>
								</configuration>
							</execution>
						</executions>
					</plugin>

					<plugin>
						<groupId>io.fabric8</groupId>
						<artifactId>docker-maven-plugin</artifactId>
						<version>0.45.1</version>
						<extensions>true</extensions>
						<configuration>
							<autoPull>true</autoPull>
							<startParallel>false</startParallel>
							<showLogs>true</showLogs>
							<autoCreateCustomNetworks>true</autoCreateCustomNetworks>
							<images>
								<image>
									<alias>hartmann_postgres</alias>
									<name>postgres:11</name>
									<run>
										<ports>
											<port>5430:5432</port>
										</ports>
										<network>
											<name>hartmann_nw</name>
											<alias>hartmann_postgres</alias>
										</network>
										<env>
											<POSTGRES_HOST_AUTH_METHOD>trust</POSTGRES_HOST_AUTH_METHOD>
										</env>
										<volumes>
											<bind>
												<volume>${basedir}/src/main/docker/sql:/docker-entrypoint-initdb.d</volume>
											</bind>
										</volumes>
										<wait>
											<log>database system is ready to accept connections</log>
											<time>2500000</time>
										</wait>
									</run>
								</image>

								<image>
									<!-- Artifact Image -->
									<name>${project.artifactId}</name>
									<alias>hartmann</alias>
									<build>
										<dockerFile>Dockerfile</dockerFile>
										<args>
											<deploymentDir>maven</deploymentDir>
										</args>
										<tags>
											<tag>latest</tag>
										</tags>
									</build>
									<registry>hub.heyday.marketing</registry>
									<run>
										<cmd>
											/srv/wait-for-it.sh
											hartmann_postgres:5432" --
											/srv/wildfly/bin/standalone-jacoco.sh
											-b 0.0.0.0 -c test-standalone.xml
										</cmd>
										<ports>
											<port>8180:8080</port>
										</ports>
										<dependsOn>
											<container>hartmann_postgres</container>

										</dependsOn>
										<network>
											<name>hartmann_nw</name>
											<alias>hartmann</alias>
										</network>
										<volumes>
											<bind>
												<volume>${basedir}/target:/srv/target</volume>
											</bind>
										</volumes>
										<wait>
											<!-- The plugin waits until this URL
											is reachable via HTTP ... -->
											<http>
												<url>http://${docker.host.address}:8180/api/monitoring/check/hello</url>
											</http>
											<time>300000</time>
										</wait>
									</run>
								</image>
							</images>
						</configuration>
						<executions>
							<execution>
								<id>build</id>
								<phase>package</phase>
								<goals>
									<goal>build</goal>
									<!-- <goal>push</goal> -->
								</goals>
							</execution>
							<execution>
								<id>start</id>
								<phase>pre-integration-test</phase>
								<goals>
									<goal>start</goal>
								</goals>
							</execution>
							<execution>
								<id>stop</id>
								<phase>post-integration-test</phase>
								<goals>
									<goal>stop</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-resources-plugin</artifactId>
						<version>3.0.2</version>
						<executions>
							<execution>
								<id>copy-resources</id>
								<!-- here the phase you need -->
								<phase>validate</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<configuration>
									<outputDirectory>${basedir}/src/main/docker</outputDirectory>
									<resources>
										<resource>
											<directory>${basedir}/../hartmann-foto-documentation-web/target/</directory>
											<includes>
												<include>*.war</include>
											</includes>
										</resource>
									</resources>
								</configuration>
							</execution>
							<execution>
								<id>copy-resources2</id>
								<!-- here the phase you need -->
								<phase>package</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<configuration>
									<outputDirectory>${project.basedir}/target/classes</outputDirectory>
									<resources>
										<resource>
											<directory>${project.basedir}/../hartmann-foto-documentation-app/target/classes</directory>
											<filtering>false</filtering>
										</resource>
									</resources>
								</configuration>
							</execution>

							<execution>
								<id>copy-jacoco-app</id>
								<!-- here the phase you need -->
								<phase>verify</phase>
								<goals>
									<goal>copy-resources</goal>
								</goals>
								<configuration>
									<outputDirectory>${project.basedir}/../hartmann-foto-documentation-app/target</outputDirectory>
									<resources>
										<resource>
											<directory>${project.basedir}/target</directory>
											<filtering>false</filtering>
											<includes>
												<include>jacoco-it.exec</include>
											</includes>
										</resource>
									</resources>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<dependencies>


		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>3.141.59</version> <!-- was 3.11.0 -->
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-edge-driver</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-firefox-driver</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-ie-driver</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-opera-driver</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.seleniumhq.selenium</groupId>
					<artifactId>selenium-safari-driver</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-api</artifactId>
			<version>3.141.59</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-chrome-driver</artifactId>
			<version>3.141.59</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-remote-driver</artifactId>
			<version>3.141.59</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-support</artifactId>
			<version>3.141.59</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>hartmann-foto-documentation-web</artifactId>
			<version>${project.version}</version>
			<type>war</type>
		</dependency>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>hartmann-foto-documentation-app</artifactId>
			<version>${project.version}</version>
		</dependency>


		<!-- Websocket test api's -->
		<dependency>
			<groupId>javax.websocket</groupId>
			<artifactId>javax.websocket-client-api</artifactId>
			<version>1.0</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.glassfish.tyrus</groupId>
			<artifactId>tyrus-client</artifactId>
			<version>1.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.glassfish.tyrus</groupId>
			<artifactId>tyrus-container-grizzly</artifactId>
			<version>1.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.json</groupId>
			<artifactId>javax.json-api</artifactId>
			<version>1.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.glassfish</groupId>
			<artifactId>javax.json</artifactId>
			<version>1.1</version>
			<scope>test</scope>
		</dependency>
		<!-- Websocket test api's -->


		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>${version.commons-lang3}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.jacoco</groupId>
			<artifactId>org.jacoco.core</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.dbunit</groupId>
			<artifactId>dbunit</artifactId>
			<version>2.7.0</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>junit</groupId>
					<artifactId>junit</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.slf4j</groupId>
					<artifactId>slf4j-api</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.jboss.resteasy</groupId>
			<artifactId>resteasy-jackson2-provider</artifactId>
			<version>${version.org.jboss.resteasy}</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.codehaus.jackson</groupId>
			<artifactId>jackson-core-asl</artifactId>
			<version>1.9.13</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.codehaus.jackson</groupId>
			<artifactId>jackson-mapper-asl</artifactId>
			<version>1.9.13</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-suite-engine</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-suite-api</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-commons</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.platform</groupId>
			<artifactId>junit-platform-launcher</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${version.commons-io}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-logging</groupId>
			<artifactId>commons-logging</artifactId>
			<version>${version.commons-logging}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>fluent-hc</artifactId>
			<version>4.5.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpmime</artifactId>
			<version>4.5.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.15</version>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>javax.mail</groupId>
					<artifactId>mail</artifactId>
				</exclusion>
				<exclusion>
					<groupId>javax.jms</groupId>
					<artifactId>jms</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jdmk</groupId>
					<artifactId>jmxtools</artifactId>
				</exclusion>
				<exclusion>
					<groupId>com.sun.jmx</groupId>
					<artifactId>jmxri</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>org.xmlunit</groupId>
			<artifactId>xmlunit-core</artifactId>
			<version>2.8.2</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.skyscreamer</groupId>
			<artifactId>jsonassert</artifactId>
			<version>1.2.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-simple</artifactId>
			<version>1.7.5</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
