<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>

	<parent>
		<groupId>com.diozero</groupId>
		<artifactId>diozero</artifactId>
		<version>1.4.0</version>
	</parent>

	<artifactId>diozero-remote-server</artifactId>
	<packaging>jar</packaging>
	<name>diozero - Remote Server</name>

	<properties>
		<mainClass>com.diozero.remote.server.grpc.GrpcServer</mainClass>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<mainClass>${mainClass}</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<!-- build a "shaded/shadow jar" - makes it executable with all dependencies -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>3.4.1</version>
				<configuration>
					<createDependencyReducedPom>false</createDependencyReducedPom>
					<transformers>
						<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
							<mainClass>${mainClass}</mainClass>
						</transformer>
					</transformers>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>com.diozero</groupId>
				<artifactId>diozero-remote-common</artifactId>
				<version>${diozero.version}</version>
			</dependency>
			<dependency>
				<groupId>io.grpc</groupId>
				<artifactId>grpc-bom</artifactId>
				<version>${grpc.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>org.tinylog</groupId>
				<artifactId>slf4j-tinylog</artifactId>
				<version>${tinylog.version}</version>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>com.diozero</groupId>
			<artifactId>diozero-core</artifactId>
		</dependency>
		<dependency>
			<groupId>com.diozero</groupId>
			<artifactId>diozero-remote-common</artifactId>
		</dependency>

		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-protobuf</artifactId>
		</dependency>
		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-stub</artifactId>
		</dependency>
		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-services</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>annotations-api</artifactId>
			<version>6.0.53</version>
			<scope>provided</scope> <!-- not needed at runtime -->
		</dependency>
		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-netty-shaded</artifactId>
			<scope>runtime</scope>
		</dependency>
		<!-- gRPC uses slf4j -->
		<dependency>
			<groupId>org.tinylog</groupId>
			<artifactId>slf4j-tinylog</artifactId>
		</dependency>

		<dependency>
			<groupId>io.grpc</groupId>
			<artifactId>grpc-testing</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
