<?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">

  <parent>
    <groupId>io.vertx</groupId>
    <artifactId>vertx-parent</artifactId>
    <version>8</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>

  <artifactId>vertx-service-proxy</artifactId>
  <version>3.1.0</version>

  <properties>
    <stack.version>3.1.0</stack.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-codegen</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-lang-js</artifactId>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-core</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <!-- the vertx-eventbus client is copied to src/test/resources to always be in sync -->
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web</artifactId>
      <classifier>client</classifier>
      <version>${project.version}</version>
      <scope>test</scope>
      <type>js</type>
    </dependency>

  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <!-- Configure the execution of the compiler to execute the codegen processor -->
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <executions>
            <execution>
              <id>default-testCompile</id>
              <configuration>
                <annotationProcessors>
                  <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                </annotationProcessors>
                <generatedTestSourcesDirectory>${project.basedir}/src/test/generated</generatedTestSourcesDirectory>
                <compilerArgs>
                  <arg>-AoutputDirectory=${project.basedir}/src/test</arg>
                </compilerArgs>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.10</version>
        <executions>
          <execution>
            <id>copy-vertx-eventbus</id>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <phase>process-test-resources</phase>
            <configuration>
              <includeArtifactIds>vertx-web</includeArtifactIds>
              <includeClassifiers>client</includeClassifiers>
              <outputDirectory>${project.basedir}/src/test/resources/vertx-js</outputDirectory>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.8</version>
        <executions>
          <execution>
            <id>rename-vertx-eventbus</id>
            <goals>
              <goal>run</goal>
            </goals>
            <phase>process-test-resources</phase>
            <configuration>
              <target>
                <move file="${project.basedir}/src/test/resources/vertx-js/vertx-web-client.js"
                      tofile="${project.basedir}/src/test/resources/vertx-js/vertx-eventbus.js"/>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
