<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>

	<groupId>cd.connect.features</groupId>
	<artifactId>feature-service-client-grpc</artifactId>
	<version>1.2</version>
	<name>feature-service-client-grpc</name>

	<description>
    Accelerate Feature Toggle GRPC client for Java.
	</description>

	<url>https://clearpointnz.github.io/connect/</url>
	<developers>
		<developer>
			<email>richard@bluetrainsoftware.com</email>
			<id>rvowles</id>
			<name>Richard Vowles</name>
			<organization>on behalf of ClearPoint NZ Ltd</organization>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>Apache License 2.0</name>
			<url>https://opensource.org/licenses/Apache-2.0</url>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:clearpointnz/connect-feature-toggle-server.git</connection>
		<developerConnection>scm:git:git@github.com:clearpointnz/connect-feature-toggle-server.git</developerConnection>
		<url>git@github.com:clearpointnz/connect-feature-toggle-server.git</url>
		<tag>feature-service-client-grpc-1.2</tag>
	</scm>

  <properties>
    <grpc.version>1.13.1</grpc.version>
    <protobuf.version>3.4.0</protobuf.version>
  </properties>

  <dependencies>

    <dependency>
      <groupId>cd.connect.composites.java</groupId>
      <artifactId>connect-composite-log4j2</artifactId>
      <version>[1.1,2)</version>
      <scope>provided</scope>
    </dependency>

	  <dependency>
		  <groupId>cd.connect.features</groupId>
		  <artifactId>connect-feature-grpc-api</artifactId>
		  <version>[1.1,2)</version>
	  </dependency>
	  <dependency>
		  <groupId>cd.connect.features</groupId>
		  <artifactId>feature-service-client-base</artifactId>
		  <version>[1.1,2)</version>
	  </dependency>

    <!-- grpc -->
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-netty</artifactId>
      <version>${grpc.version}</version>
	    <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-protobuf</artifactId>
      <version>${grpc.version}</version>
	    <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-stub</artifactId>
      <version>${grpc.version}</version>
	    <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>${protobuf.version}</version>
	    <scope>provided</scope>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>cd.connect.composites.java</groupId>
      <artifactId>connect-composite-test</artifactId>
      <version>[1.1,2)</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
	  <extensions>
		  <extension>
			  <groupId>kr.motd.maven</groupId>
			  <artifactId>os-maven-plugin</artifactId>
			  <version>1.5.0.Final</version>
		  </extension>
	  </extensions>
    <plugins>
	    <plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-dependency-plugin</artifactId>
		    <executions>
			    <execution>
				    <id>unpack feature service definition</id>
				    <phase>initialize</phase>
				    <goals>
					    <goal>unpack</goal>
				    </goals>
				    <!--<phase>generate-sources</phase>-->
				    <configuration>
					    <artifactItems>
						    <artifactItem>
							    <groupId>cd.connect.features</groupId>
							    <artifactId>connect-feature-grpc-api</artifactId>
							    <version>1.1-SNAPSHOT</version>
							    <type>jar</type>
							    <outputDirectory>${project.basedir}/target/protobuf</outputDirectory>
						    </artifactItem>
					    </artifactItems>
					    <overWriteReleases>true</overWriteReleases>
					    <overWriteSnapshots>true</overWriteSnapshots>
				    </configuration>
			    </execution>
		    </executions>
	    </plugin>
	    <plugin>
		    <groupId>org.xolstice.maven.plugins</groupId>
		    <artifactId>protobuf-maven-plugin</artifactId>
		    <version>0.5.0</version>
		    <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>
			    <protoSourceRoot>target/protobuf</protoSourceRoot>
		    </configuration>
		    <executions>
			    <execution>
				    <id>grpc</id>
				    <phase>generate-sources</phase>
				    <goals>
					    <goal>compile</goal>
					    <goal>compile-custom</goal>
				    </goals>
			    </execution>
		    </executions>
	    </plugin>
      <plugin>
        <groupId>io.repaint.maven</groupId>
        <artifactId>tiles-maven-plugin</artifactId>
        <version>2.10</version>
        <extensions>true</extensions>
        <configuration>
          <filtering>false</filtering>
          <tiles>
            <tile>cd.connect.tiles:tile-java:[1.1, 2)</tile>
            <!--<tile>cd.connect.tiles:tile-groovy:[1.1, 2)</tile>-->
          </tiles>
        </configuration>
      </plugin>
    </plugins>
  </build>
  
</project>
