<?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>9</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>

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

  <properties>
    <stack.version>3.3.3</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>io.vertx</groupId>
      <artifactId>vertx-docgen</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codetrans</artifactId>
      <optional>true</optional>
    </dependency>

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

    <dependency>
      <groupId>com.jayway.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>1.7.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.3.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <executions>
            <execution>
              <id>default-clean</id>
              <configuration>
                <filesets>
                  <fileset>
                    <directory>src/main/asciidoc</directory>
                  </fileset>
                  <fileset>
                    <directory>${asciidoc.dir}</directory>
                  </fileset>
                </filesets>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <!-- Configure the execution of the compiler to execute the codegen processor -->
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <executions>
            <execution>
              <id>default-compile</id>
              <configuration>
                <annotationProcessors>
                  <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
                  <annotationProcessor>io.vertx.docgen.JavaDocGenProcessor</annotationProcessor>
                  <annotationProcessor>io.vertx.docgen.DocGenProcessor</annotationProcessor>
                </annotationProcessors>
                <generatedSourcesDirectory>${project.basedir}/target/generated-for-docs</generatedSourcesDirectory>
                <compilerArgs>
                  <arg>-AoutputDirectory=${project.basedir}/target/generated-for-docs</arg>
                  <arg>-Adocgen.output=${asciidoc.dir}/$lang</arg>

                  <arg>-Amaven.groupId=${project.groupId}</arg>
                  <arg>-Amaven.artifactId=${project.artifactId}</arg>
                  <arg>-Amaven.version=${project.version}</arg>
                </compilerArgs>
              </configuration>
            </execution>
            <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>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>asciidoctor</id>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
            <configuration>
              <skip>${doc.skip}</skip>
            </configuration>
            <phase>prepare-package</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>doc</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <attach>true</attach>
              <descriptors>
                <descriptor>${basedir}/src/main/assembly/docs.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
