<?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.2</version>
    <relativePath>../..</relativePath>
  </parent>

  <artifactId>instrumentation-jaxrs</artifactId>

  <name>Instrumentation for JAX-RS</name>
  <description>Instrumentation for JAX-RS</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>
    <!-- jersey 2.26+ requires Java 8+ -->
    <jersey.version>2.25.1</jersey.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.glowroot.instrumentation</groupId>
      <artifactId>instrumentation-api</artifactId>
      <version>${project.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>org.glowroot.instrumentation</groupId>
      <artifactId>instrumentation-test-harness</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.ning</groupId>
      <artifactId>async-http-client</artifactId>
      <!-- async-http-client 1.9.0+ requires Java 7+ -->
      <version>1.8.17</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-core</artifactId>
      <!-- tomcat 8.0.0+ requires Java 7+ -->
      <version>7.0.91</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-jasper</artifactId>
      <!-- tomcat 8.0.0+ requires Java 7+ -->
      <version>7.0.91</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-logging-juli</artifactId>
      <!-- tomcat 8.0.0+ requires Java 7+ -->
      <version>7.0.91</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <!-- this is needed because logback classic 1.1.10+ contains
        META-INF/services/javax.servlet.ServletContainerInitializer which causes issues when running
        tests with embedded tomcat inside JavaagentContainer because logback is loaded in the
        bootstrap class loader (see JavaagentContainer.java) and so
        LogbackServletContainerInitializer is loaded in the bootstrap class loader which then
        looks for ServletContainerInitializer in the bootstrap class loader, but it is not, and
        adding tomcat-embed-core (which has ServletContainerInitializer) to the bootstrap class
        loader causes NullPointerException in org.apache.catalina.startup.ContextConfig

        to get around this problem, javax.servlet-api artifact is included, and put in the bootstrap
        class loader (see JavaagentContainer.java) so that logback's ServletContainerInitializer
        can load in the the bootstrap class loader successfully
      -->
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <!-- Tomcat 7 (above) uses Servlet API 3.0 -->
      <version>3.0.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet</artifactId>
      <version>${jersey.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-server</artifactId>
      <version>${jersey.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <!-- servlet plugin is included to capture transactions -->
      <groupId>org.glowroot.instrumentation</groupId>
      <artifactId>instrumentation-servlet</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <!-- executor plugin is included to test async responses -->
      <groupId>org.glowroot.instrumentation</groupId>
      <artifactId>instrumentation-executor</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>not-test-java6</id>
      <activation>
        <property>
          <name>!test.java6</name>
        </property>
      </activation>
      <dependencies>
        <!-- these dependencies require Java 7+ -->
        <dependency>
          <!-- this is needed for running tests on Java 9 -->
          <groupId>javax.xml.bind</groupId>
          <artifactId>jaxb-api</artifactId>
          <version>2.3.1</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <!-- this is needed for running tests on Java 9 -->
          <groupId>com.sun.activation</groupId>
          <artifactId>javax.activation</artifactId>
          <version>1.2.0</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
    <profile>
      <id>jersey-2.26</id>
      <dependencies>
        <dependency>
          <groupId>org.glassfish.jersey.inject</groupId>
          <artifactId>jersey-hk2</artifactId>
          <version>${jersey.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
