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

    <groupId>com.adaptavist.performance</groupId>
    <artifactId>testframework</artifactId>
    <version>2.2.2</version>
    <dependencies>
        <dependency>
            <groupId>io.gatling.highcharts</groupId>
            <artifactId>gatling-charts-highcharts</artifactId>
            <version>2.3.1</version>
        </dependency>
        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1</version>
        </dependency>
    </dependencies>
    <distributionManagement>
        <snapshotRepository>
            <id>nexus-snapshots</id>
            <url>https://nexus.adaptavist.com/content/repositories/adaptavist-snapshots</url>
        </snapshotRepository>
        <repository>
            <id>${repo-id}</id>
            <url>${repo-url}</url>
        </repository>
    </distributionManagement>
    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>reports.GetReportData</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <version>3.3.2</version>
                <executions>
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                            <goal>add-source</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>io.gatling</groupId>
                <artifactId>gatling-maven-plugin</artifactId>
                <version>2.2.4</version>
                <configuration>
                    <runMultipleSimulations>true</runMultipleSimulations>
                    <runDescription>${gatling.runDesc}</runDescription>
                    <simulationClass>${gatling.testName}</simulationClass>
                </configuration>
                <executions>
                    <execution>
                        <id>gatling-tests</id>
                        <goals>
                            <goal>integration-test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
    <profiles>
        <profile>
            <id>no-tests-internal</id>
            <properties>
                <repo-id>nexus</repo-id>
                <repo-url>https://nexus.adaptavist.com/content/repositories/adaptavist</repo-url>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.gatling</groupId>
                        <artifactId>gatling-maven-plugin</artifactId>
                        <version>2.2.4</version>
                        <configuration>
                            <runMultipleSimulations>true</runMultipleSimulations>
                            <runDescription>${gatling.runDesc}</runDescription>
                            <simulationClass>${gatling.testName}</simulationClass>
                        </configuration>
                        <executions>
                            <execution>
                                <id>gatling-tests</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>no-tests-external</id>
            <properties>
                <repo-id>nexus</repo-id>
                <repo-url>https://nexus.adaptavist.com/content/repositories/external</repo-url>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.gatling</groupId>
                        <artifactId>gatling-maven-plugin</artifactId>
                        <version>2.2.4</version>
                        <configuration>
                            <runMultipleSimulations>true</runMultipleSimulations>
                            <runDescription>${gatling.runDesc}</runDescription>
                            <simulationClass>${gatling.testName}</simulationClass>
                        </configuration>
                        <executions>
                            <execution>
                                <id>gatling-tests</id>
                                <phase>none</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


</project>