<?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.glowroot.instrumentation</groupId>
    <artifactId>instrumentation-parent</artifactId>
    <version>0.14.7</version>
    <relativePath>../..</relativePath>
  </parent>

  <artifactId>instrumentation-netty</artifactId>

  <name>Instrumentation for Netty</name>
  <description>Instrumentation for Netty</description>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <netty4x.version>4.1.35.Final</netty4x.version>
    <netty3x.version>3.10.6.Final</netty3x.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.glowroot.instrumentation</groupId>
      <artifactId>instrumentation-api</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-all</artifactId>
      <version>${netty4x.version}</version>
      <scope>provided</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.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glowroot.instrumentation</groupId>
      <artifactId>instrumentation-test-harness</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty</artifactId>
      <version>${netty3x.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <!-- using apache httpclient instead of asynchttpclient to avoid netty conflicts with
        different play versions -->
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.6</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <!-- these tests requires netty 4.1.0+, and they also require Java 7 because of test dependency 
        on httpclient5 (can't find any http/2 client libraries that support Java 6) -->
      <id>netty-http2</id>
      <activation>
        <property>
          <name>!test.noDefaultProfiles</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <!-- httpclient5 is needed for http/2 support -->
          <groupId>org.apache.httpcomponents.client5</groupId>
          <artifactId>httpclient5</artifactId>
          <version>5.0-beta3</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <!-- this is to resolve maven enforcer RequireUpperBoundDeps error -->
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
          <version>1.11</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>test-netty-http2</id>
                <phase>generate-test-sources</phase>
                <goals>
                  <goal>add-test-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/test/netty-http2/java</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
