<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.hedera.hashgraph</groupId>
    <artifactId>hedera-protobuf-java-api</artifactId>
    <packaging>jar</packaging>
    <version>0.9.0-alpha5</version>

    <name>hedera-protobuf-java-api</name>
  	<description>Protobuf Java API for Hedera Hashgraph</description>
  	<url>http://www.hedera.com</url>

  	<licenses>
  		<license>
  			<name>Apache License, Version 2.0</name>
  			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
  			<distribution>repo</distribution>
  		</license>
  	</licenses>

  	<developers>
  		<developer>
  			<organization>Hedera Hashgraph</organization>
  			<organizationUrl>http://www.hedera.com</organizationUrl>
  		</developer>
  	</developers>

  	<scm>
  		<connection>scm:git:git@github.com:hashgraph/hedera-protobuf.git</connection>
  		<developerConnection>scm:git:git@github.com:hashgraph/hedera-protobuf.git</developerConnection>
  		<url>https://github.com/hashgraph/hedera-protobuf</url>
  	  <tag>hedera-protobuf-java-api-0.9.0-alpha5</tag>
  </scm>

  	<distributionManagement>
  		<snapshotRepository>
  			<id>ossrh</id>
  			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
  		</snapshotRepository>
  		<repository>
  			<id>ossrh</id>
  			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
  		</repository>
  	</distributionManagement>

    <properties>
        <app.name>hedera-protobuf-java-api</app.name>
        <grpc.version>1.13.1</grpc.version>
        <os.plugin.version>1.6.0</os.plugin.version>
        <protobuf.plugin.version>0.5.0</protobuf.plugin.version>
        <protoc.version>3.5.1</protoc.version>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-netty</artifactId>
            <version>${grpc.version}</version>
        </dependency>

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-protobuf</artifactId>
            <version>${grpc.version}</version>
        </dependency>

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-stub</artifactId>
            <version>${grpc.version}</version>
        </dependency>

        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-testing</artifactId>
            <version>${grpc.version}</version>
        </dependency>


        <dependency>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
            <version>3.5.1</version>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>

		<dependency>
			<groupId>net.i2p.crypto</groupId>
			<artifactId>eddsa</artifactId>
			<version>0.3.0</version>
		</dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.11</version>
        </dependency>
    </dependencies>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>

      <!-- definition of the used plugins and their version -->
      <pluginManagement>
          <plugins>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
                  <version>3.8.1</version>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <version>3.1.1</version>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-deploy-plugin</artifactId>
                  <version>3.0.0-M1</version>
              </plugin>
              <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-source-plugin</artifactId>
                  <version>3.2.0</version>
              </plugin>
          </plugins>
      </pluginManagement>

      <!-- applying plugins to the maven build -->
<plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.source}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>${app.name}</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                 <execution>
                  <id>attach-sources</id>
                  <goals>
                   <goal>jar-no-fork</goal>
                  </goals>
                 </execution>
                </executions>
               </plugin>
            <!--  JAVADOC local -->
      			<plugin>
      				<groupId>org.apache.maven.plugins</groupId>
      				<artifactId>maven-javadoc-plugin</artifactId>
      				<configuration>
      					<javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
      					<reportOutputDirectory>${project.basedir}/javadoc</reportOutputDirectory>
      				</configuration>
      				<executions>
      					<execution>
      						<phase>install</phase>
      						<id>attach-javadocs</id>
      						<goals>
      							<goal>javadoc</goal>
      						</goals>
      					</execution>
      				</executions>
      			</plugin>

            <plugin>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>${os.plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>${protobuf.plugin.version}</version>
                <configuration>
                    <protocArtifact>com.google.protobuf:protoc:${protoc.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>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-release-plugin</artifactId>
              <version>2.5.3</version>
              <configuration>
                <autoVersionSubmodules>true</autoVersionSubmodules>
                <useReleaseProfile>false</useReleaseProfile>
                <releaseProfiles>release</releaseProfiles>
                <goals>deploy</goals>
              </configuration>
            </plugin>
                  </plugins>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
            </extension>
        </extensions>
    </build>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>2.8</version>
				<configuration>
					<dependencyLocationsEnabled>false</dependencyLocationsEnabled>
				</configuration>
			</plugin>
		</plugins>
	</reporting>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
            </configuration>
            <executions>
              <execution>
                <phase>deploy</phase>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-gpg-plugin</artifactId>
              <version>1.6</version>
              <executions>
                  <execution>
                      <id>sign-artifacts</id>
                      <phase>deploy</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.8</version>
               <executions>
                  <execution>
                     <id>default-deploy</id>
                     <phase>deploy</phase>
                     <goals>
                        <goal>deploy</goal>
                     </goals>
                  </execution>
               </executions>
               <configuration>
                 <serverId>ossrh</serverId>
                 <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                  <skipStaging>false</skipStaging>
               </configuration>
            </plugin>
         </plugins>
      </build>
    </profile>
  </profiles>
</project>
