<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2011-2016 The original author or authors
  ~
  ~ All rights reserved. This program and the accompanying materials
  ~ are made available under the terms of the Eclipse Public License v1.0
  ~ and Apache License v2.0 which accompanies this distribution.
  ~
  ~      The Eclipse Public License is available at
  ~      http://www.eclipse.org/legal/epl-v10.html
  ~
  ~      The Apache License v2.0 is available at
  ~      http://www.opensource.org/licenses/apache2.0.php
  ~
  ~ You may elect to redistribute this code under either of these licenses.
  -->

<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>io.vertx</groupId>
    <artifactId>vertx-service-discovery-parent</artifactId>
    <version>3.3.2</version>
  </parent>

  <artifactId>vertx-service-discovery</artifactId>

  <properties>
    <doc.skip>false</doc.skip>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-hazelcast</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-jdbc-client</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>com.jayway.restassured</groupId>
      <artifactId>rest-assured</artifactId>
      <version>2.8.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
      <version>2.3.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>src/test/groovy</directory>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.10</version>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.basedir}/src/test/generated</source>
                <source>${project.basedir}/src/test/groovy</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
        <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>src/main/generated</generatedSourcesDirectory>
              <compilerArgs>
                <arg>-AoutputDirectory=${project.basedir}/src/main</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>compile-groovy-from-tests</id>
            <phase>process-test-sources</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <compilerId>groovy-eclipse-compiler</compilerId>
            </configuration>
          </execution>
          <execution>
            <id>default-testCompile</id>
            <configuration>
              <annotationProcessors>
                <annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
              </annotationProcessors>
              <generatedTestSourcesDirectory>src/test/generated</generatedTestSourcesDirectory>
              <compilerArgs>
                <arg>-AoutputDirectory=${project.basedir}/src/test</arg>
              </compilerArgs>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.1-01</version>
          </dependency>
          <!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
          <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.3.7-01</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

</project>
