<?xml version="1.0"?>
<!--
  ~ Copyright (c) 2011-2014 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-web-parent</artifactId>
    <version>5.0.1</version>
  </parent>

  <artifactId>vertx-web-openapi-router</artifactId>

  <name>Vert.x Web OpenApi Router</name>

  <properties>
    <junit5.version>5.7.0</junit5.version>
    <truth.version>1.1.3</truth.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-json-schema</artifactId>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-openapi</artifactId>
    </dependency>
    <!-- Optionals (Security) -->
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-jwt</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-auth-oauth2</artifactId>
      <optional>true</optional>
    </dependency>

    <!-- For docs -->

    <!-- Testing dependencies -->
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-web-client</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-junit5</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit5.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>${truth.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
<!--
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <release>11</release>
          <compilerArgument>-proc:none</compilerArgument>
        </configuration>
      </plugin>
-->
<!--
      <plugin>
        <groupId>org.bsc.maven</groupId>
        <artifactId>maven-processor-plugin</artifactId>
        <version>3.3.3</version>
        <executions>
          <execution>
            <id>generate-test-sources</id>
            <goals>
              <goal>process-test</goal>
            </goals>
            <phase>generate-test-sources</phase>
            <configuration>
              <processors>
                <processor>io.vertx.codegen.CodeGenProcessor</processor>
              </processors>
              <excludes>
                <exclude>**/*Test.java</exclude>
              </excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.13.0</version>
          <executions>
            <execution>
              <id>default-testCompile</id>
              <configuration>
                <compilerArgs>
                  <!--
                  Needed because using OpenAPIContractImpl directly
                  find a way to avoid this
                  -->
                  <arg>--add-exports</arg>
                  <arg>io.vertx.openapi/io.vertx.openapi.contract.impl=io.vertx.web.openapi.router.tests</arg>
                </compilerArgs>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.0</version>
          <configuration>
            <argLine>
              --add-exports io.vertx.openapi/io.vertx.openapi.validation.impl=com.fasterxml.jackson.databind
              --add-exports io.vertx.openapi/io.vertx.openapi.contract.impl=io.vertx.web.openapi.router.tests
            </argLine>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
