<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>

    <artifactId>asset-module</artifactId>
    <name>${project.parent.artifactId}-module</name>
    <packaging>war</packaging>

    <parent>
	    <groupId>fish.focus.uvms.asset</groupId>
	    <artifactId>asset</artifactId>
	    <version>6.8.25</version>
	    <relativePath>../pom.xml</relativePath>
    </parent>

    <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>
    
        <wildfly.maven.plugin.version>2.0.2.Final</wildfly.maven.plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>fish.focus.uvms.maven</groupId>
            <artifactId>uvms-pom-gis-deps</artifactId>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>fish.focus.uvms.asset</groupId>
            <artifactId>asset-model</artifactId>
            <version>${project.parent.version}</version>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.audit</groupId>
            <artifactId>audit-model</artifactId>
            <version>${audit.model.version}</version>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.lib</groupId>
            <artifactId>uvms-config</artifactId>
            <version>${uvms.config.version}</version>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.commons</groupId>
            <artifactId>uvms-commons-message</artifactId>
            <version>${uvms.common.version}</version>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.commons</groupId>
            <artifactId>uvms-commons-rest</artifactId>
            <version>${uvms.common.version}</version>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.commons</groupId>
            <artifactId>uvms-commons-date</artifactId>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.maven</groupId>
            <artifactId>uvms-pom-monitoring-deps</artifactId>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.exchange</groupId>
            <artifactId>exchange-client</artifactId>
            <version>${exchange.model.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.lib</groupId>
            <artifactId>usm4uvms</artifactId>
            <version>${usm4uvms.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>fish.focus.uvms.commons</groupId>
                    <artifactId>uvms-commons-message</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>fish.focus.uvms.maven</groupId>
            <artifactId>uvms-pom-arquillian-deps</artifactId>
            <type>pom</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-jms-client</artifactId>
            <version>2.20.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-json_1.0_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.johnzon</groupId>
                    <artifactId>johnzon-core</artifactId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>2.32</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
            <version>2.32</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-binding</artifactId>
            <version>2.32</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.json.bind</groupId>
            <artifactId>javax.json.bind-api</artifactId>
            <version>1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse</groupId>
            <artifactId>yasson</artifactId>
            <version>1.0.8</version>
            <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>asset</Logging-Profile>
                        </manifestEntries>
                    </archive>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <!-- USE following command to run this profile: mvn clean install -Pwildfly-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>
                        <executions>
                            <execution>
                                <id>undeploy</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>undeploy</goal>
                                </goals>
                                <configuration>
                                    <match-pattern>${project.name}-.*</match-pattern>
                                </configuration>
                            </execution>
                            <execution>
                                <id>deploy</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                                <configuration>
                                    <filename>${project.build.finalName}.${project.packaging}</filename>
                                    <targetDir>${project.build.directory}</targetDir>
                                    <force>true</force>
                                </configuration>
                            </execution>
                        </executions>
                        <configuration>
                            <hostname>${hostname}</hostname>
                            <port>${port}</port>
                            <username>${username}</username>
                            <password>${password}</password>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>