<?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>de.dentrassi.kura</groupId>
	<artifactId>kura-simulator</artifactId>
	<version>0.1.0</version>

	<name>Eclipse Kura™ simulator framework</name>
	<description>This is a framework for simulating Eclipse Kura IoT gateway instances</description>

	<url>https://dentrassi.de/2017/02/14/testing-kapua-with-simulated-kura-gateways</url>

	<inceptionYear>2017</inceptionYear>

	<developers>
		<developer>
			<id>ctron</id>
			<name>Jens Reimann</name>
			<email>jreimann@redhat.com</email>

			<organization>Red Hat Inc</organization>
			<organizationUrl>http://redhat.com</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git://github.com/ctron/kura-simulator.git</connection>
		<url>https://github.com/ctron/kura-simulator</url>
		<developerConnection>scm:git:git@github.com:ctron/kura-simulator.git</developerConnection>
	  <tag>kura-simulator-0.1.0</tag>
  </scm>

	<issueManagement>
		<url>https://github.com/ctron/kura-simulator/issues</url>
		<system>GitHub Issues</system>
	</issueManagement>

	<licenses>
		<license>
			<name>The Eclipse Public License Version 1.0</name>
			<url>http://www.eclipse.org/legal/epl-v10.html</url>
			<distribution>manual</distribution>
		</license>
	</licenses>

	<prerequisites>
		<maven>3.3</maven>
	</prerequisites>

	<properties>
		<slf4j.version>1.7.22</slf4j.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<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>

	<dependencies>
		<dependency>
			<groupId>org.eclipse.paho</groupId>
			<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
			<version>1.1.0</version>
		</dependency>

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

		<dependency>
			<groupId>org.apache.httpcomponents</groupId>
			<artifactId>httpclient</artifactId>
			<version>4.5.2</version>
		</dependency>

		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.5</version>
		</dependency>

		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
			<version>21.0</version>
		</dependency>

		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>org.osgi.core</artifactId>
			<version>6.0.0</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>jul-to-slf4j</artifactId>
			<version>${slf4j.version}</version>
			<optional>true</optional>
		</dependency>

		<dependency>
			<groupId>commons-cli</groupId>
			<artifactId>commons-cli</artifactId>
			<version>1.3.1</version>
			<optional>true</optional>
		</dependency>

		<!-- scope : runtime -->

		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<version>1.1.8</version>
			<scope>runtime</scope>
			<optional>true</optional>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>com.github.os72</groupId>
				<artifactId>protoc-jar-maven-plugin</artifactId>
				<executions>
					<execution>
						<phase>generate-sources</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<protocVersion>2.6.1</protocVersion>
							<includeStdTypes>true</includeStdTypes>
							<inputDirectories>
								<include>src/main/protobuf</include>
							</inputDirectories>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<configuration>
					<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
					</transformer>
					<shadedArtifactAttached>true</shadedArtifactAttached>
					<filters>
						<filter>
							<artifact>*:*</artifact>
							<excludes>
								<exclude>META-INF/ECLIPSE_.*</exclude>
								<exclude>OSGI-OPT/**</exclude>
							</excludes>
						</filter>
					</filters>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<configuration>
					<pushRegistry>registry.hub.docker.com</pushRegistry>
					<images>
						<image>
							<name>ctron/kura-simulator</name>
							<build>
								<from>java:8-jre-alpine</from>
								<maintainer>Jens Reimann &lt;jreimann@redhat.com&gt;</maintainer>
								<tags>
									<tag>${project.version}</tag>
								</tags>
								<assembly>
									<mode>dir</mode>
									<targetDir>/opt/${project.artifactId}</targetDir>
									<descriptor>kura-simulator.xml</descriptor>
								</assembly>
								<runCmds>
									<runCmd>adduser -D -g "" simulator</runCmd>
								</runCmds>
								<user>simulator</user>
								<entryPoint>
									<exec>
										<arg>java</arg>
										<arg>-Dlogback.configurationFile=/opt/${project.artifactId}/logback.xml</arg>
										<arg>-cp</arg>
										<arg>/opt/${project.artifactId}/${project.artifactId}-${project.version}-shaded.jar</arg>
										<arg>org.eclipse.kapua.kura.simulator.main.SimulatorRunner</arg>
									</exec>
								</entryPoint>
							</build>
						</image>
					</images>
				</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>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<useReleaseProfile>false</useReleaseProfile>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
				</configuration>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.6.1</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.2.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.9.1</version>
				</plugin>

				<plugin>
					<groupId>io.fabric8</groupId>
					<artifactId>docker-maven-plugin</artifactId>
					<version>0.19.1</version>
				</plugin>

				<plugin>
					<groupId>com.github.os72</groupId>
					<artifactId>protoc-jar-maven-plugin</artifactId>
					<version>3.1.0.5</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>3.0.0</version>
				</plugin>

			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>disable-java8-doclint</id>
			<activation>
				<jdk>[1.8,)</jdk>
			</activation>
			<properties>
				<additionalparam>-Xdoclint:none</additionalparam>
			</properties>
		</profile>
	</profiles>

</project>