<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.xwiki.projectmanagement</groupId>
    <artifactId>project-management-test</artifactId>
    <version>1.1.0-alpha-3-SNAPSHOT</version>
  </parent>
  <artifactId>project-management-test-docker</artifactId>
  <name>Project Management - Tests - Functional Docker Tests</name>
  <description>Functional tests for the Project Management features.</description>
  <properties>
    <!-- Functional tests are allowed to output content to the console -->
    <xwiki.surefire.captureconsole.skip>true</xwiki.surefire.captureconsole.skip>
  </properties>
  <dependencies>

    <dependency>
      <groupId>com.xwiki.projectmanagement</groupId>
      <artifactId>project-management-openproject-ui</artifactId>
      <version>${project.version}</version>
      <type>xar</type>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-wiki-ui-mainwiki</artifactId>
      <version>${platform.version}</version>
      <type>xar</type>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-wiki-creationjob</artifactId>
      <version>${platform.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-wiki-template-default</artifactId>
      <version>${platform.version}</version>
    </dependency>
    <!-- Use a fake licensor script service while running the functional tests. -->
    <dependency>
      <groupId>com.xwiki.licensing</groupId>
      <artifactId>application-licensing-test-api</artifactId>
      <version>${licensing.version}</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-test-docker</artifactId>
      <version>${platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.xwiki.projectmanagement</groupId>
      <artifactId>project-management-test-pageobjects</artifactId>
      <scope>test</scope>
      <version>${project.version}</version>
    </dependency>
    <!-- Provide an implementation for the HTMLDisplayer (needed by MacroDescriptorUIFactory to get the edit template for
      macro parameters). -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-display-html</artifactId>
      <version>${platform.version}</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
  <build>
    <testSourceDirectory>src/test/it</testSourceDirectory>
    <plugins>
      <!-- We need to explicitly include the failsafe plugin since it's not part of the default maven lifecycle -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
      </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>org.openclover</groupId>
          <artifactId>clover</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <!-- Tell the Docker-based test to activate the Clover profile so that the Clover JAR is added to
                     WEB-INF/lib -->
                <xwiki.test.ui.profiles>clover</xwiki.test.ui.profiles>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
