<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>io.vertx</groupId>
    <artifactId>vertx-ext-parent</artifactId>
    <version>34</version>
  </parent>

  <artifactId>vertx-sync</artifactId>
  <version>3.9.0</version>

  <properties>
    <stack.version>3.9.0</stack.version>

    <quasar-core.version>0.7.10</quasar-core.version>
    <quasar-maven-plugin.version>0.7.9</quasar-maven-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-dependencies</artifactId>
        <version>${stack.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>co.paralleluniverse</groupId>
      <artifactId>quasar-core</artifactId>
      <version>${quasar-core.version}</version>
      <classifier>jdk8</classifier>
      <exclusions>
        <exclusion>
          <groupId>io.dropwizard.metrics</groupId>
          <artifactId>metrics-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.latencyutils</groupId>
          <artifactId>LatencyUtils</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.hdrhistogram</groupId>
          <artifactId>HdrHistogram</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.protobuf</groupId>
          <artifactId>protobuf-java</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-docgen</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codetrans</artifactId>
      <optional>true</optional>
    </dependency>
    <!-- Force to 25.1-jre as that's the stack version -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>25.1-jre</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-unit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>

    <pluginManagement>
      <plugins>
        <!-- Collecting classpath entries as properties in the form groupId:artifactId:type:[classifier]
             as per http://maven.apache.org/plugins/maven-dependency-plugin/properties-mojo.html -->
        <plugin>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>2.8</version>
          <executions>
            <execution>
              <id>getClasspathFilenames</id>
              <goals>
                <goal>properties</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.vlkan</groupId>
        <artifactId>quasar-maven-plugin</artifactId>
        <version>${quasar-maven-plugin.version}</version>
        <configuration>
          <check>true</check>
          <debug>true</debug>
          <verbose>true</verbose>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>instrument</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <!--
          override the internal dependency to use the same quasar version as the one used by vert.x sync, it
          works until they change the API.
          -->
          <dependency>
            <groupId>co.paralleluniverse</groupId>
            <artifactId>quasar-core</artifactId>
            <version>${quasar-core.version}</version>
          </dependency>
        </dependencies>
      </plugin>

      <!-- Collecting classpath entries as properties in the form groupId:artifactId:type:[classifier]
           as per http://maven.apache.org/plugins/maven-dependency-plugin/properties-mojo.html -->
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>getClasspathFilenames</id>
            <goals>
              <goal>properties</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>

          <!--<systemPropertyVariables>-->
          <!--<co.paralleluniverse.fibers.verifyInstrumentation>true</co.paralleluniverse.fibers.verifyInstrumentation>-->
          <!--</systemPropertyVariables>-->
          <!--<argLine>-Dco.paralleluniverse.fibers.verifyInstrumentation=true</argLine>-->

          <!-- Enable if using compile-time (AoT) instrumentation -->
          <!-- argLine>-Dco.paralleluniverse.fibers.disableAgentWarning</argLine -->

          <!-- Quasar Agent for JDK 7 -->
          <argLine>-javaagent:${co.paralleluniverse:quasar-core:jar:jdk8}</argLine>
          <!--<forkCount>1</forkCount>-->
          <!--<reuseForks>true</reuseForks>-->
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
