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

  <parent>
    <groupId>org.sonarsource.java</groupId>
    <artifactId>it-java-plugin</artifactId>
    <version>7.8.0.28662</version>
  </parent>

  <artifactId>it-java-plugin-tests</artifactId>
  <name>SonarQube Java :: ITs :: Plugin :: Tests</name>

  <properties>
    <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>it-java-plugin-plugins</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.orchestrator</groupId>
      <artifactId>sonar-orchestrator</artifactId>
      <version>${orchestrator.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>com.oracle</groupId>
          <artifactId>ojdbc6</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarlint.core</groupId>
      <artifactId>sonarlint-core</artifactId>
      <version>${sonarlint.plugin.api.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarlint.core</groupId>
      <artifactId>sonarlint-plugin-api</artifactId>
      <version>${sonarlint.plugin.api.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.sonarsource.sonarqube</groupId>
      <artifactId>sonar-ws</artifactId>
      <version>${sonar.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <argLine>-server</argLine>
            <includes>
              <include>com/sonar/it/java/suite/*TestSuite.java</include>
              <include>com/sonar/it/java/*Test.java</include>
            </includes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.googlecode.maven-download-plugin</groupId>
          <artifactId>download-maven-plugin</artifactId>
          <version>1.6.3</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>download-jre-8-linux</id>
      <activation>
        <os>
          <family>unix</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.googlecode.maven-download-plugin</groupId>
            <artifactId>download-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-jre-linux</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>wget</goal>
                </goals>
                <configuration>
                  <url>https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u265-b01/OpenJDK8U-jre_x64_linux_hotspot_8u265b01.tar.gz</url>
                  <unpack>true</unpack>
                  <outputDirectory>${project.build.directory}/jre</outputDirectory>
                  <sha256>9bce39f63d24626da75778f240294fa466a0ed117e32db798164621fe30b0723</sha256>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>download-jre-8-windows</id>
      <activation>
        <os>
          <family>windows</family>
        </os>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>com.googlecode.maven-download-plugin</groupId>
            <artifactId>download-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-jre-windows</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>wget</goal>
                </goals>
                <configuration>
                  <url>https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u265-b01/OpenJDK8U-jre_x86-32_windows_hotspot_8u265b01.zip</url>
                  <unpack>true</unpack>
                  <outputDirectory>${project.build.directory}/jre</outputDirectory>
                  <sha256>1d1624afe2aaa811e2bf09fb1c432f3f0ad4b8a7b6243db2245390f1b59a17cf</sha256>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>download-jre-8-macosx</id>
      <activation>
        <os>
          <family>mac</family>
        </os>
      </activation>
      <properties>
        <jre.dirname>jdk8u256-b01-jre/Contents/Home</jre.dirname>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>com.googlecode.maven-download-plugin</groupId>
            <artifactId>download-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-jre-macosx</id>
                <phase>package</phase>
                <goals>
                  <goal>wget</goal>
                </goals>
                <configuration>
                  <url>https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u265-b01/OpenJDK8U-jre_x64_mac_hotspot_8u265b01.tar.gz</url>
                  <unpack>true</unpack>
                  <outputDirectory>${project.build.directory}/jre</outputDirectory>
                  <sha256>6df6bd51fbc4527546308e1e1c06954e380e264e84b3263b0c128f8d0288eb51</sha256>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
