<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2020 Kentyou.
  ~ All rights reserved. This program and the accompanying materials
  ~ are made available under the terms of the Eclipse Public License v1.0
  ~ which accompanies this distribution, and is available at
  ~ http://www.eclipse.org/legal/epl-v10.html
  ~
  ~ Contributors:
*    Kentyou - initial API and implementation
  -->

<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>org.eclipse.sensinact.gateway.nthbnd</groupId>
		<artifactId>mqtt</artifactId>
		<version>2.0-SNAPSHOT</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>mqtt-agent</artifactId>
	<name>sensiNact IoT Gateway - MQTT Northbound Agent Instance</name>

	<dependencies>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway</groupId>
			<artifactId>sensinact-utils</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway</groupId>
			<artifactId>sensinact-common</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway</groupId>
			<artifactId>sensinact-core</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway.nthbnd</groupId>
			<artifactId>mqtt-generic-agent</artifactId>
			<version>${project.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.paho</groupId>
			<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway.tools</groupId>
			<artifactId>sensinact-test</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.skyscreamer</groupId>
			<artifactId>jsonassert</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway.simulated.devices</groupId>
			<artifactId>slider</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.util.converter</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.sensinact.gateway.tools</groupId>
			<artifactId>mqtt-server</artifactId>
			<version>${project.version}</version>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>biz.aQute.bnd</groupId>
				<artifactId>bnd-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>generate-test-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.basedir}/target/felix/load</outputDirectory>
							<resources>
								<resource>
									<directory>${project.basedir}/src/test/resources/</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<id>keystoreCopy</id>
						<phase>generate-test-resources</phase>
						<configuration>
							<target>
								<mkdir dir="${project.build.directory}/felix/tmp" />
								<copy file="../../../sensinact-security/cert/keystore.jks"
									tofile="${project.build.directory}/felix/bundle/keystore.jks" />
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>