<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>
  <parent>
    <groupId>org.nuxeo.ecm.distribution</groupId>
    <artifactId>nuxeo-distribution</artifactId>
    <version>6.0-HF03</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>nuxeo-distribution-cap-webdriver-tests</artifactId>
  <name>Nuxeo CAP WebDriver Tests</name>
  <description>WebDriver functional tests on CAP distribution</description>

  <properties>
    <connect.password>setTheValueInYourSettings</connect.password>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.distribution</groupId>
      <artifactId>nuxeo-distribution-tomcat</artifactId>
      <classifier>nuxeo-cap</classifier>
      <type>zip</type>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.distribution</groupId>
      <artifactId>nuxeo-functional-tests</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.runtime</groupId>
      <artifactId>nuxeo-runtime-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.core</groupId>
      <artifactId>nuxeo-core-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <configuration>
              <archive>
                <manifestFile>src/test/resources/META-INF/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <skipTests>true</skipTests>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
            <configuration>
              <argLine>-Dlog4j.configuration=${file.uri.prefix}${basedir}/src/main/resources/log4j.xml
                -Dnuxeo.log.dir=${project.build.directory}
                -DconnectPassword=${connect.password}
                ${it.failsafe.argLine}
              </argLine>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.nuxeo.build</groupId>
        <artifactId>ant-assembly-maven-plugin</artifactId>
        <configuration>
          <buildFile>${basedir}/itests.xml</buildFile>
        </configuration>
        <executions>
          <execution>
            <id>start-tomcat</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <targets>
                <target>prepare-environment</target>
                <target>start</target>
              </targets>
            </configuration>
          </execution>
          <execution>
            <id>stop-tomcat</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <targets>
                <target>stop</target>
                <target>cleanup-environment</target>
              </targets>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>tomcat</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
    </profile>
    <profile>
      <id>pgsql</id>
    </profile>
    <profile>
      <id>mssql</id>
    </profile>
    <profile>
      <id>oracle10g</id>
    </profile>
    <profile>
      <id>oracle11g</id>
    </profile>
    <profile>
      <id>mysql</id>
    </profile>
  </profiles>

</project>