<?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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>au.com.integradev.delphi</groupId>
    <artifactId>delphi</artifactId>
    <version>1.20.0</version>
  </parent>

  <artifactId>its</artifactId>

  <name>SonarDelphi :: ITs</name>

  <properties>
    <skipTests>${skipITs}</skipTests>
    <proxyHost/>
    <proxyPort/>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>delphi-frontend</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-suite-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarqube</groupId>
      <artifactId>sonar-ws</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.orchestrator</groupId>
      <artifactId>sonar-orchestrator</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.orchestrator</groupId>
      <artifactId>sonar-orchestrator-junit5</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>@{argLine} -Dhttps.proxyHost=${proxyHost} -Dhttps.proxyPort=${proxyPort}</argLine>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>proxy-host-defined</id>
      <activation>
        <property>
          <name>env.HTTP_PROXY_SERVER</name>
        </property>
      </activation>
      <properties>
        <proxyHost>${env.HTTP_PROXY_SERVER}</proxyHost>
      </properties>
    </profile>
    <profile>
      <id>proxy-port-defined</id>
      <activation>
        <property>
          <name>env.HTTP_PROXY_PORT</name>
        </property>
      </activation>
      <properties>
        <proxyPort>${env.HTTP_PROXY_PORT}</proxyPort>
      </properties>
    </profile>
  </profiles>
</project>