<?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">
  <parent>
    <artifactId>alfresco-benchmark-common</artifactId>
    <groupId>org.alfresco</groupId>
    <version>1.6</version>
    <relativePath>../pom.xml/pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.alfresco</groupId>
  <artifactId>alfresco-benchmark-webdrone</artifactId>
  <version>1.4.2</version>
  <scm>
    <connection>scm:svn:http://svn.alfresco.com/repos/alfresco-open-mirror/benchmark/webdrone/tags/V1.4.2</connection>
    <developerConnection>scm:svn:https://svn.alfresco.com/repos/alfresco-enterprise/benchmark/webdrone/tags/V1.4.2</developerConnection>
  </scm>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.13</version>
        <configuration>
          <runOrder>alphabetical</runOrder>
          <argLine>-Xms512m -Xmx1024m</argLine>
          <excludedGroups>${webdrone.exclude}</excludedGroups>
          <workingDirectory>target</workingDirectory>
          <systemPropertyVariables>
            <webdrone.max.waitTime>${webdrone.max.waitTime}</webdrone.max.waitTime>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <tagNameFormat>V@{project.version}</tagNameFormat>
          <tagBase>https://svn.alfresco.com/repos/alfresco-enterprise/benchmark/webdrone/tags</tagBase>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>default-cli</id>
            <configuration>
              <target>
                <echo>Stopping Alfresco...</echo>
                <exec>
                  <arg />
                </exec>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>install-alfresco</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
              <execution>
                <id>fetch-installer</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <echo>Recreating database...</echo>
                    <sql>drop database if exists alfresco; create database alfresco</sql>
                    <echo>Downloading Alfresco installer...</echo>
                    <scp />
                    <chmod />
                    <echo>Installing Alfresco...</echo>
                    <exec>
                      <arg />
                    </exec>
                  </target>
                </configuration>
              </execution>
            </executions>
            <dependencies>
              <dependency>
                <groupId>org.apache.ant</groupId>
                <artifactId>ant-jsch</artifactId>
                <version>1.8.2</version>
              </dependency>
              <dependency>
                <groupId>postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>9.1-901-1.jdbc4</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>run-alfresco</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
              <execution>
                <id>start-alfresco</id>
                <phase>process-test-classes</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <echo>Starting Alfresco...</echo>
                    <exec>
                      <arg />
                    </exec>
                    <sleep />
                  </target>
                </configuration>
              </execution>
              <execution>
                <id>stop-alfresco</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <target>
                    <echo>Stopping Alfresco...</echo>
                    <exec>
                      <arg />
                    </exec>
                  </target>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <properties>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <sonar.jacoco.reportPath>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPath>
    <webdrone.max.waitTime>6000</webdrone.max.waitTime>
    <webdrone.exclude>nonEnterprise</webdrone.exclude>
    <sonar.exclusions>org/alfresco/webdrone/WebDroneClient.java</sonar.exclusions>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>

