<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.bitsensor</groupId>
  <artifactId>proto</artifactId>
  <name>BitSensor Proto</name>
  <version>0.10.2-RC2</version>
  <description>BitSensor Proto library</description>
  <url>https://git.bitsensor.io/common/protobuf</url>
  <issueManagement>
    <system>GitLab</system>
    <url>https://git.bitsensor.io/common/protobuf/issues</url>
  </issueManagement>
  <developers>
    <developer>
      <name>Bram Mulders</name>
      <email>bram@bitsensor.io</email>
    </developer>
    <developer>
      <name>Ruben van Vreeland</name>
      <email>ruben@bitsensor.io</email>
    </developer>
    <developer>
      <name>Khanh Nguyen</name>
      <email>khanh@bitsensor.io</email>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>The MIT License</name>
      <url>https://git.bitsensor.io/common/protobuf/blob/master/LICENSE.md</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://git.bitsensor.io/common/protobuf.git</connection>
    <developerConnection>scm:git:ssh://git.bitsensor.io:common/protobuf.git</developerConnection>
    <url>https://git.bitsensor.io/common/protobuf</url>
  </scm>
  <organization>
    <name>BitSensor</name>
    <url>https://bitsensor.io/</url>
  </organization>
  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.4.1.Final</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>0.5.0</version>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>compile-custom</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <protocArtifact>com.google.protobuf:protoc:${protobuf.version}: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>me.nqkdev.plugins</groupId>
        <artifactId>hamcrest-proto-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>generate-hamcrest-matchers</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <target>${protobuf.output.directory}</target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
            <manifestEntries>
              <Implementation-Version>${project.version} (${maven.build.timestamp})</Implementation-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>com.google.guava:*</include>
                  <include>com.google.protobuf:*</include>
                  <include>com.google.api.grpc:*</include>
                  <include>com.google.instrumentation:*</include>
                  <include>com.google.code.gson:*</include>
                  <include>io.netty:*</include>
                  <include>io.grpc:*</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>io.bitsensor.proto.shaded.com.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.netty</pattern>
                  <shadedPattern>io.bitsensor.proto.shaded.io.netty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.grpc</pattern>
                  <shadedPattern>io.bitsensor.proto.shaded.io.grpc</shadedPattern>
                </relocation>
              </relocations>
              <transformers>
                <transformer />
              </transformers>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>ci</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>injected-nexus-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <serverId>ossrh</serverId>
                  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                  <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <os.detected.release.version>9</os.detected.release.version>
        <os.detected.release>debian</os.detected.release>
        <os.detected.name>linux</os.detected.name>
        <os.detected.release.like.debian>true</os.detected.release.like.debian>
        <os.detected.classifier>linux-x86_64</os.detected.classifier>
        <os.detected.arch>x86_64</os.detected.arch>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <version>2.0.0.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <name>Nexus Release Repository</name>
      <url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <protobuf.version>3.2.0</protobuf.version>
    <protobuf.output.directory>${project.build.directory}/generated-sources/protobuf/java</protobuf.output.directory>
    <os-maven-plugin.version>1.4.1.Final</os-maven-plugin.version>
    <grpc.version>1.3.0</grpc.version>
    <maven-shade-plugin.version>3.0.0</maven-shade-plugin.version>
    <protobuf.input.directory>${project.basedir}/src/main/proto</protobuf.input.directory>
  </properties>
</project>

