<?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-jdbc</artifactId>

  <name>Instrumentation for JDBC</name>
  <description>Instrumentation for JDBC</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>
    <h2.version>1.4.197</h2.version>
    <hsqldb.version>2.4.1</hsqldb.version>
    <postgresql.version>42.2.5.jre6</postgresql.version>
    <mysql.version>5.1.43</mysql.version>
    <!-- mssql-jdbc 6.5.0+ requires Java 8+ (there is no version published on maven central that
      supports Java 6) -->
    <mssql.version>6.4.0.jre7</mssql.version>
    <commons.dbcp.version>1.4</commons.dbcp.version>
    <commons.dbcp2.version>2.5.0</commons.dbcp2.version>
    <tomcat.version>7.0.92</tomcat.version>
    <glassfish.jdbc.version>4.1.2</glassfish.jdbc.version>
    <hikari.cp.artifactId>HikariCP-java6</hikari.cp.artifactId>
    <hikari.cp.version>2.3.13</hikari.cp.version>
    <bitronix.groupId>com.github.marcus-nl.btm</bitronix.groupId>
    <bitronix.version>3.0.0-mk1</bitronix.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.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>${hsqldb.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>${h2.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${postgresql.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>${mysql.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.microsoft.sqlserver</groupId>
      <artifactId>mssql-jdbc</artifactId>
      <version>${mssql.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-dbcp</groupId>
      <artifactId>commons-dbcp</artifactId>
      <version>${commons.dbcp.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-dbcp2</artifactId>
      <version>${commons.dbcp2.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>tomcat-jdbc</artifactId>
      <!-- tomcat 8 requires Java 7+ -->
      <version>${tomcat.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.tomcat</groupId>
      <artifactId>tomcat-juli</artifactId>
      <version>${tomcat.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish.main.jdbc.jdbc-ra.jdbc40</groupId>
      <artifactId>jdbc40</artifactId>
      <version>${glassfish.jdbc.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <!-- conflicts with the engine's asm version -->
          <groupId>org.glassfish.external</groupId>
          <artifactId>asm-all</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.zaxxer</groupId>
      <artifactId>${hikari.cp.artifactId}</artifactId>
      <version>${hikari.cp.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>${bitronix.groupId}</groupId>
      <artifactId>btm</artifactId>
      <version>${bitronix.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <!-- this is needed to make bitronix use its JdbcJavassistProxyFactory which needs special
        weaving consideration -->
      <version>3.18.2-GA</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>test-java-7-and-later</id>
      <activation>
        <property>
          <name>!test.java6</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>test-java-7-and-later</id>
                <goals>
                  <goal>add-test-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>src/test/java-7-and-later</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>test-java-6</id>
      <activation>
        <property>
          <name>test.java6</name>
        </property>
      </activation>
      <dependencies>
        <dependency>
          <groupId>javax.transaction</groupId>
          <artifactId>jta</artifactId>
          <version>1.1</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.glassfish.main.jdbc.jdbc-ra.jdbc40</groupId>
          <artifactId>jdbc40</artifactId>
          <version>${glassfish.jdbc.version}</version>
          <scope>test</scope>
          <exclusions>
            <exclusion>
              <!-- conflicts with the engine's asm version -->
              <groupId>org.glassfish.external</groupId>
              <artifactId>asm-all</artifactId>
            </exclusion>
            <exclusion>
              <!-- need to use Java 6 compatible JTA (above) -->
              <groupId>javax.transaction</groupId>
              <artifactId>javax.transaction-api</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
