<?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>connect-feature-service</artifactId>
	<version>1.1</version>
	<name>feature-service</name>

	<description>
		This is the core functionality of the feature toggle service. It orchestrates the GRPC and
		REST clients and validates their changes and pushes them to the backend.
	</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>connect-feature-service-1.1</tag>
	</scm>


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

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

		<dependency>
			<groupId>cd.connect.servlet</groupId>
			<artifactId>servlet-spring</artifactId>
			<version>[1.6,2)</version>
			<scope>provided</scope>
		</dependency>

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

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

		<!-- provided, we don't dictate these versions or combinations -->
		<dependency>
			<groupId>cd.connect.composites.java</groupId>
			<artifactId>connect-composite-springwebapp</artifactId>
			<version>[1.2,2)</version>
			<scope>provided</scope>
		</dependency>

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

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

		<!-- grpc -->
		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-netty</artifactId>
			<version>1.7.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-protobuf</artifactId>
			<version>1.7.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-stub</artifactId>
			<version>1.7.0</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>

		<dependency>
			<groupId>cd.connect.composites.java</groupId>
			<artifactId>connect-composite-groovy</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:3.4.0:exe:${os.detected.classifier}</protocArtifact>
					<pluginId>grpc-java</pluginId>
					<pluginArtifact>io.grpc:protoc-gen-grpc-java:1.7.0: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>
