<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.automation</groupId>
    <artifactId>nuxeo-automation-parent</artifactId>
    <version>5.8.0-HF33</version>
  </parent>

  <artifactId>nuxeo-automation-test</artifactId>
  <name>Nuxeo Automation Tests</name>
  <description>Automation Tests</description>

  <properties>
    <nuxeo.tested.version>5.8.0-HF33</nuxeo.tested.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.nuxeo.ecm.automation</groupId>
      <artifactId>nuxeo-automation-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.automation</groupId>
      <artifactId>nuxeo-automation-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.automation</groupId>
      <artifactId>nuxeo-automation-core</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>jsr311-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.webengine</groupId>
      <artifactId>nuxeo-webengine-jaxrs</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.core</groupId>
      <artifactId>nuxeo-core-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.core</groupId>
      <artifactId>nuxeo-core-schema</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.runtime</groupId>
      <artifactId>nuxeo-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.common</groupId>
      <artifactId>nuxeo-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-core-asl</artifactId>
    </dependency>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.runtime</groupId>
      <artifactId>nuxeo-runtime-test</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.core</groupId>
      <artifactId>nuxeo-core-test</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-features-test</artifactId>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-test</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuxeo.ecm.automation</groupId>
      <artifactId>nuxeo-automation-client</artifactId>
      <exclusions>
        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
        </exclusion>
        <exclusion>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuxeo.ecm.automation</groupId>
      <artifactId>nuxeo-automation-features</artifactId>
    </dependency>

    <!-- For webengine servlet? -->
    <dependency>
      <groupId>org.nuxeo.ecm.webengine</groupId>
      <artifactId>nuxeo-webengine-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-naming</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-plus</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-util</artifactId>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.runtime</groupId>
      <artifactId>nuxeo-runtime-jtajca</artifactId>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
    </dependency>

    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-url-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-url-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-types-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-types-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-audit-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-audit-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.ecm.platform</groupId>
      <artifactId>nuxeo-platform-audit-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.nuxeo.runtime</groupId>
      <artifactId>nuxeo-runtime-datasource</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-client</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/UploadBigFileTest.java</exclude>
            <exclude>**/RemoteAutomationClientTest.java</exclude>
            <exclude>**/RemoteAutomationClientTCK.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.nuxeo.build</groupId>
        <artifactId>nuxeo-distribution-tools</artifactId>
        <executions>
          <execution>
            <id>build-marketplace</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>build</goal>
            </goals>
            <configuration>
              <buildFiles>
                <buildFile>${basedir}/src/main/marketplace/assemble/assembly.xml</buildFile>
              </buildFiles>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>withIT</id>
      <!-- Comment activation when tests are not skipped NXBT-586
        <activation>
        <property>
        &lt;!&ndash; Skip exec if skipTests is defined. Using NXBT-568 would be better.
        &ndash;&gt;
        <name>!skipTests</name>
        </property>
        </activation> -->
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <includes>
                <include>**/RemoteAutomationClientTest.java</include>
                <include>**/RemoteAutomationClientTCK.java</include>
              </includes>
              <argLine>-Dlog4j.configuration=${file.uri.prefix}${basedir}/src/test/resources/log4j.properties
                -Dnuxeo.log.dir=${build.directory}
              </argLine>
            </configuration>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.nuxeo.build</groupId>
            <artifactId>nuxeo-distribution-tools</artifactId>
            <executions>
              <execution>
                <id>build-marketplace</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>build</goal>
                </goals>
                <configuration>
                  <buildFiles>
                    <buildFile>${basedir}/src/main/marketplace/assemble/assembly.xml</buildFile>
                  </buildFiles>
                </configuration>
              </execution>
              <execution>
                <id>start-tomcat</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>build</goal>
                </goals>
                <configuration>
                  <buildFiles>
                    <buildFile>${basedir}/itests.xml</buildFile>
                  </buildFiles>
                  <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>
                  <buildFiles>
                    <buildFile>${basedir}/itests.xml</buildFile>
                  </buildFiles>
                  <target>stop</target>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>