<?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>
    <artifactId>integration-tests</artifactId>
    <name>Integration Tests Module</name>
    <description>Integration Tests module for in-container integration testing - part of AIO - SDK 3</description>
    <packaging>jar</packaging> <!-- Note. this just runs Integration Tests, but it needs to be a JAR otherwise
                                            nothing is compiled (i.e. you cannot set it to pom) -->

    <parent>
        <groupId>com.github.nwforrer</groupId>
        <artifactId>file-encryption</artifactId>
        <version>1.1.3</version>
    </parent>

    <properties>
    </properties>

    <dependencies>
        <!-- Bring in any custom module that should be tested, by default we bring in the Platform JAR module
             that is generated for the AIO project -->
        <dependency>
            <groupId>com.github.nwforrer</groupId>
            <artifactId>file-encryption-platform-jar</artifactId>
            <version>1.1.3</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>

        <plugins>

            <plugin>
                <groupId>org.zeroturnaround</groupId>
                <artifactId>jrebel-maven-plugin</artifactId>
                <version>${jrebel.version}</version>
                <configuration>
                    <rebelXmlDirectory>${project.build.testOutputDirectory}</rebelXmlDirectory>
                </configuration>
            </plugin>

            <!-- Make sure we attach the tests so we can include them when running -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.0.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Runs the integration tests, any class that follows naming convention
                 "**/IT*.java", "**/*IT.java", and "**/*ITCase.java" will be considered an integration test -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.19.1</version>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>verify-test</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>2.19.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!-- Run Alfresco Tomcat embedded -->
            <plugin>
                <groupId>org.alfresco.maven.plugin</groupId>
                <artifactId>alfresco-maven-plugin</artifactId>
                <version>${alfresco.sdk.version}</version>
                <executions>
                    <execution>
                        <id>start-alfresco</id>
                        <goals>
                            <goal>it</goal>
                        </goals>
                        <phase>pre-integration-test</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
