<?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>fish.focus.uvms.exchange</groupId>
        <artifactId>exchange</artifactId>
        <version>5.3.26</version>
    </parent>

    <artifactId>exchange-module</artifactId>
    <packaging>war</packaging>

    <properties>
        <docker.dev.start.phase>test-compile</docker.dev.start.phase>
        <docker.liquibase.phase>test-compile</docker.liquibase.phase>
        <docker.dev.prestop.phase>validate</docker.dev.prestop.phase>
        <docker.liquibase.changeLogFile>../LIQUIBASE/changelog/db-changelog-master.xml</docker.liquibase.changeLogFile>
    </properties>

    <dependencies>
        <!-- Project modules-->

        <dependency>
            <groupId>fish.focus.uvms.asset</groupId>
            <artifactId>asset-client</artifactId>
            <version>${asset.version}</version>
        </dependency>

        <!-- Third party libs -->
        <dependency>
            <groupId>fish.focus.uvms.maven</groupId>
            <artifactId>uvms-pom-monitoring-deps</artifactId>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.maven</groupId>
            <artifactId>uvms-pom-java11-deps</artifactId>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

        <!-- Uvms libs -->
        <dependency>
            <groupId>fish.focus.uvms.lib</groupId>
            <artifactId>uvms-config</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.lib</groupId>
            <artifactId>usm4uvms</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.commons</groupId>
            <artifactId>uvms-commons-message</artifactId>
        </dependency>

        <!-- Models -->
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>exchange-model</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.user</groupId>
            <artifactId>user-model</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.audit</groupId>
            <artifactId>audit-model</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.movement</groupId>
            <artifactId>movement-model</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.movement-rules</groupId>
            <artifactId>movement-rules-model</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.asset</groupId>
            <artifactId>asset-model</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.activity</groupId>
            <artifactId>activity-model</artifactId>
        </dependency>

        <!-- Test -->

        <dependency>
            <groupId>fish.focus.uvms.maven</groupId>
            <artifactId>uvms-pom-arquillian-deps</artifactId>
            <type>pom</type>
            <scope>test</scope>
        </dependency>

    </dependencies>
    
    <build>
        <finalName>${project.name}-${project.version}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webResources>
                        <resource>
                            <directory>src/main/webapp</directory>
                            <filtering>true</filtering>
                        </resource>
                    </webResources>
                    <archive>
                        <manifestEntries>
                            <Logging-Profile>exchange</Logging-Profile>
                        </manifestEntries>
                    </archive>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
        </plugins>
    </build>
    
    <!-- USE following command to run this profile: mvn clean install -P wildfly-deploy wildfly:deploy -Dhostname=127.0.0.1 -Dport=9990 -Dusername=admin -Dpassword=asdf  -->
    <profiles>
        <profile>
            <id>wildfly-deploy</id>
            <build>
                <plugins>	
                    <plugin>
                        <groupId>org.wildfly.plugins</groupId>
                        <artifactId>wildfly-maven-plugin</artifactId>
                        <version>2.1.0.Final</version>
                        <configuration>
                            <filename>${project.build.finalName}.${project.packaging}</filename>
                            <targetDir>${project.build.directory}</targetDir>
                            <hostname>${hostname}</hostname>
                            <port>${port}</port>
                            <username>${username}</username>
                            <password>${password}</password>
                            <force>true</force>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>  
    
</project>
