<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<parent>
		<groupId>fish.focus.uvms.docker</groupId>
		<artifactId>uvms-docker</artifactId>
		<version>4.2.3</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>uvms-docker-wildfly-unionvms</artifactId>
	<packaging>pom</packaging>
	<name>uvms-docker-wildfly-unionvms</name>

	<dependencies>

		<!-- frontend modules -->
		<dependency>
			<groupId>fish.focus.uvms</groupId>
			<artifactId>unionvms-web</artifactId>
			<type>war</type>
		</dependency>

        <dependency>
            <groupId>fish.focus.uvms</groupId>
            <artifactId>vms-web</artifactId>
            <type>war</type>
        </dependency>

		<dependency>
			<groupId>fish.focus.uvms.geoserver.web.overlay</groupId>			
			<artifactId>gs-web-app</artifactId>
			<type>war</type>
		</dependency>
		

		<!-- app modules -->
		<dependency>
			<groupId>fish.focus.uvms.asset</groupId>
			<artifactId>asset-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.audit</groupId>
			<artifactId>audit-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.config</groupId>
			<artifactId>config-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.exchange</groupId>
			<artifactId>exchange-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.movement</groupId>
			<artifactId>movement-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.movement-rules</groupId>
			<artifactId>movement-rules-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.spatial</groupId>
			<artifactId>spatial-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.incident</groupId>
			<artifactId>incident-application</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.user</groupId>
			<artifactId>user-module</artifactId>
			<type>ear</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.reporting</groupId>
			<artifactId>reporting-module</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.activity</groupId>
			<artifactId>activity-application</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.web-gateway</groupId>
			<artifactId>web-gateway</artifactId>
			<type>war</type>
		</dependency>

		<!-- plugin modules -->
		<dependency>
			<groupId>fish.focus.uvms.plugins.ais</groupId>
			<artifactId>ais-module</artifactId>
			<type>ear</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.plugins.inmarsat</groupId>
			<artifactId>inmarsat-module</artifactId>
  			<type>ear</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.plugins.iridium</groupId>
			<artifactId>siriusone</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.plugins.naf</groupId>
			<artifactId>naf-module</artifactId>
			<type>ear</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.plugins.flux.movement</groupId>
			<artifactId>flux-movement-plugin-module</artifactId>
			<type>ear</type>
		</dependency>
		<dependency>
			<groupId>fish.focus.uvms.plugins.rest.movement</groupId>
			<artifactId>flux-vesselposition-rest-module</artifactId>
			<type>ear</type>
		</dependency>
	</dependencies>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>io.fabric8</groupId>
					<artifactId>docker-maven-plugin</artifactId>
					<version>0.39.1</version>
				</plugin>
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>3.3.0</version>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<copyPom>false</copyPom>
							<outputDirectory>${project.basedir}/target/dockerfile/deployments</outputDirectory>
							<excludeTypes>pom</excludeTypes>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>filter-resources</id>
						<goals>
							<goal>resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.basedir}/target/dockerfile</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/src/main/docker</directory>
									<filtering>false</filtering>
									<excludes>
										<exclude>Dockerfile</exclude>
										<exclude>**/jboss-all.xml</exclude>
									</excludes>
								</resource>
								<resource>
									<directory>${project.basedir}/src/main/docker/</directory>
									<filtering>true</filtering>
									<includes>
										<include>Dockerfile</include>
										<include>**/jboss-all.xml</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.3.0</version>
				<configuration>
					<descriptors>
						<descriptor>src/main/assembly/assembly.xml</descriptor>
					</descriptors>
					<finalName>${project.artifactId}</finalName>
					<appendAssemblyId>false</appendAssemblyId>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
				<goals>
					<goal>deploy-file</goal>
				</goals>
				<configuration>
					<packaging>zip</packaging>
					<generatePom>true</generatePom>
					<artifactId>${project.artifactId}</artifactId>
					<groupId>${project.groupId}</groupId>
					<version>${project.version}</version>
					<file>target/${project.artifactId}.zip</file>
				</configuration>
			</plugin>												
			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>package</id>
						<phase>test</phase>
						<goals>
							<goal>build</goal>
						</goals>
					</execution>
					<execution>
						<id>verifyallstopped</id>
						<phase>compile</phase>
						<goals>
							<goal>stop</goal>
						</goals>
					</execution>
					<execution>
						<id>stoppall</id>
						<phase>install</phase>
						<goals>
							<goal>stop</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<images>
						<image>
							<name>uvms/wildfly-unionvms:${project.version}</name>
							<build>
								<dockerFileDir>${project.basedir}/target/dockerfile</dockerFileDir>
							</build>
						</image>
					</images>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<profiles>
		<profile>
			<id>push-docker</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>io.fabric8</groupId>
						<artifactId>docker-maven-plugin</artifactId>
						<executions>
							<execution>
								<id>docker:push</id>
								<phase>install</phase>
								<goals>
									<goal>push</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	<scm>
		<tag>HEAD</tag>
	</scm>
</project>
