<?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>vertx5-parent</artifactId>
    <version>15</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <packaging>pom</packaging>

  <name>vertx-grpc-aggregator</name>
  <artifactId>vertx-grpc-aggregator</artifactId>
  <version>5.1.3</version>

  <scm>
    <connection>scm:git:git@github.com:eclipse-vertx/vertx-grpc.git</connection>
    <developerConnection>scm:git:git@github.com:eclipse-vertx/vertx-grpc.git</developerConnection>
    <url>git@github.com:eclipse-vertx/vertx-grpc.git</url>
  </scm>

  <properties>
    <grpc.version>1.70.0</grpc.version>
    <jprotoc.version>1.2.2</jprotoc.version>
    <protoc.version>4.29.3</protoc.version>
    <protobuf.version>4.29.3</protobuf.version>
    <!-- NOTE: We need to stay on version 3.x of ascopes protobuf maven plugin until we bump minimum version of java from
     java 11 to java 17 as starting from 4.x minimum required version is java 17.
     See: https://ascopes.github.io/protobuf-maven-plugin/plugin-info.html#system-requirements-history
     -->
    <protobuf.maven.plugin.version>3.10.3</protobuf.maven.plugin.version>
    <jmh.version>1.37</jmh.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.vertx</groupId>
        <artifactId>vertx-dependencies</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-api</artifactId>
        <version>${grpc.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>animal-sniffer-annotations</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java-util</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-protobuf</artifactId>
        <version>${grpc.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.api.grpc</groupId>
            <artifactId>proto-google-common-protos</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>animal-sniffer-annotations</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-stub</artifactId>
        <version>${grpc.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk15on</artifactId>
        <version>1.70</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>dev.jbang</groupId>
        <artifactId>jash</artifactId>
        <version>0.0.3</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-netty-shaded</artifactId>
        <version>${grpc.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>animal-sniffer-annotations</artifactId>
          </exclusion>
          <exclusion>
            <groupId>io.netty</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers</artifactId>
        <version>2.0.3</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen-api</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-codegen-json</artifactId>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-docgen-api</artifactId>
      <optional>true</optional>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.google.j2objc</groupId>
          <artifactId>j2objc-annotations</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.checkerframework</groupId>
          <artifactId>checker-qual</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.errorprone</groupId>
          <artifactId>error_prone_annotations</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>io.vertx</groupId>
      <artifactId>vertx-unit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <modules>
    <module>vertx-grpc-common</module>
    <module>vertx-grpc-transcoding</module>
    <module>vertx-grpc-server</module>
    <module>vertx-grpc-reflection</module>
    <module>vertx-grpc-health</module>
    <module>vertx-grpc-client</module>
    <module>vertx-grpc-eventbus</module>
    <module>vertx-grpcio-common</module>
    <module>vertx-grpcio-server</module>
    <module>vertx-grpcio-client</module>
    <module>vertx-grpcio-context-storage</module>
    <module>vertx-grpc-protoc-plugin2</module>
    <module>vertx-grpc-it</module>
    <module>vertx-grpc-docs</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <executions>
            <execution>
              <id>default-compile</id>
              <phase>compile</phase>
              <configuration>
                <annotationProcessorPaths>
                  <annotationProcessorPath>
                    <groupId>io.vertx</groupId>
                    <artifactId>vertx-codegen</artifactId>
                    <classifier>processor</classifier>
                  </annotationProcessorPath>
                </annotationProcessorPaths>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>io.github.ascopes</groupId>
          <artifactId>protobuf-maven-plugin</artifactId>
          <version>${protobuf.maven.plugin.version}</version>
          <configuration>
            <protocVersion>${protobuf.version}</protocVersion>
          </configuration>
          <executions>
            <execution>
              <id>test-compile</id>
              <configuration>
                <binaryMavenPlugins>
                  <binaryMavenPlugin>
                    <groupId>io.grpc</groupId>
                    <artifactId>protoc-gen-grpc-java</artifactId>
                    <version>${grpc.version}</version>
                    <!-- Skip generating @javax.annotation.Generated which creates split packages  -->
                    <options>@generated=omit</options>
                  </binaryMavenPlugin>
                </binaryMavenPlugins>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>package-docs</id>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
