<?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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.xwiki.platform</groupId>
    <artifactId>xwiki-platform-ldap-test</artifactId>
    <version>7.4.3</version>
  </parent>
  <artifactId>xwiki-platform-ldap-test-tests</artifactId>
  <name>XWiki Platform - LDAP - Tests - Functional Tests</name>
  <packaging>jar</packaging>
  <properties>
    <xwikiCfgSuperadminPassword>pass</xwikiCfgSuperadminPassword>
    <!-- Functional tests are allowed to output content to the console -->
    <xwiki.surefire.captureconsole.skip>true</xwiki.surefire.captureconsole.skip>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-ldap-authenticator</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-test-ui</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Dependencies for LDAP unit tests -->
    <dependency>
      <groupId>org.apache.directory.server</groupId>
      <artifactId>apacheds-server-unit</artifactId>
      <version>1.0.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-oldcore</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <testSourceDirectory>src/test/it</testSourceDirectory>
    <plugins>
      <!-- Make sure we only run AllTests since that test runs all the other ones, thus starting/stopping XWiki only
           once -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/AllTests.java</include>
          </includes>
          <systemPropertyVariables>
            <logback.configurationFile>logback.xml</logback.configurationFile>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <!-- TODO: Remove when the http://jira.codehaus.org/browse/MNG-1911 is fixed, see also
           http://jira.xwiki.org/jira/browse/XWIKI-7683 -->
      <plugin>
        <groupId>org.xwiki.platform</groupId>
        <artifactId>xwiki-platform-tool-packager-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>package</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>clover</id>
      <!-- Add the Clover JAR to the WAR so that it's available at runtime when XWiki executes.
           It's needed because instrumented jars in the WAR will call Clover APIs at runtime when they execute. -->
      <dependencies>
        <dependency>
          <groupId>com.atlassian.clover</groupId>
          <artifactId>clover</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <!-- Add the Clover JAR to the Packager plugin runtime classpath since the Packager plugin uses java classes
               that have been instrumented with Clover (XWiki oldcore for example) -->
          <plugin>
            <groupId>org.xwiki.platform</groupId>
            <artifactId>xwiki-platform-tool-packager-plugin</artifactId>
            <version>${project.version}</version>
            <dependencies>
              <dependency>
                <groupId>com.atlassian.clover</groupId>
                <artifactId>clover</artifactId>
                <version>${clover.version}</version>
              </dependency>
            </dependencies>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
