<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.zipkin.brave</groupId>
    <artifactId>brave-instrumentation-parent</artifactId>
    <version>4.5.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>brave-instrumentation-grpc</artifactId>
  <name>Brave Instrumentation: gRPC</name>

  <properties>
    <main.basedir>${project.basedir}/../..</main.basedir>
    <protobuf.version>3.3.1</protobuf.version>
    <os-maven-plugin.version>1.5.0.Final</os-maven-plugin.version>
    <protobuf-maven-plugin.version>0.5.0</protobuf-maven-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-all</artifactId>
      <version>${grpc.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>brave-context-log4j2</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>${os-maven-plugin.version}</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>${protobuf-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>test-compile</goal>
              <goal>test-compile-custom</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <protocArtifact>
            <!-- TODO: change to ${grpc.version} once 3.3.1 is out -->
            com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier}
          </protocArtifact>
          <pluginId>grpc-java</pluginId>
          <pluginArtifact>
            io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
          </pluginArtifact>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <configuration>
          <extraArtifacts>
            <extraArtifact>io.grpc:grpc-all:1.2.0:jar</extraArtifact>
            <extraArtifact>com.google.protobuf:protoc:3.2.0:exe:${os.detected.classifier}</extraArtifact>
          </extraArtifacts>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
