<?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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>net.eusashead.mqtt</groupId>
	<artifactId>rxmqtt</artifactId>
	<packaging>jar</packaging>
	<version>1.0.2.RELEASE</version>
	<name>rxmqtt</name>
	<url>https://github.com/patrickvankann/rxmqtt</url>
	<description>An RxJava API for handling MQTT messages with an implementation using the Paho Java MQTT library.</description>

	<properties>
		<license.organizationName>Eusa's Head</license.organizationName>
		<license.inceptionYear>2013</license.inceptionYear>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<docker.maven.plugin.fabric8.version>0.15.9</docker.maven.plugin.fabric8.version>
	</properties>


	<scm>
		<connection>scm:git:ssh://git@github.com:patrickvankann/rxmqtt.git</connection>
		<developerConnection>scm:git:git@github.com:patrickvankann/rxmqtt.git</developerConnection>
		<url>https://github.com/patrickvankann/rxmqtt</url>
		<tag>rxmqtt-1.0.2.RELEASE</tag>
	</scm>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>

	<developers>
		<developer>
			<id>patrickvk</id>
			<name>Patrick van Kann</name>
			<email>pvankann at the mail of the Google</email>
		</developer>
	</developers>

	<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>io.reactivex</groupId>
			<artifactId>rxjava</artifactId>
			<version>1.2.0</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.12</version>
			<scope>test</scope>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.mockito/mockito-all -->
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-all</artifactId>
			<version>1.10.19</version>
			<scope>test</scope>
		</dependency>

		<!-- https://mvnrepository.com/artifact/org.hamcrest/java-hamcrest -->
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>java-hamcrest</artifactId>
			<version>2.0.0.0</version>
		</dependency>

	</dependencies>

	<build>
		<plugins>

			<!-- Maven compiler plugin -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.3</version>
				<configuration>
					<source>${java.version}</source>
					<target>${java.version}</target>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<version>3.6</version>
			</plugin>

			<!-- Fabric8 Docker Maven plugin -->
			<plugin>
				<groupId>io.fabric8</groupId>
				<artifactId>docker-maven-plugin</artifactId>
				<version>${docker.maven.plugin.fabric8.version}</version>
				<configuration>
					<logDate>default</logDate>
					<autoPull>true</autoPull>
					<images>
						<image>
							<alias>rabbitmq</alias>
							<name>eusashead/rabbitmq:1.0.0</name>
							<run>
								<ports>
									<port>15672:15672</port>
									<port>1883:1883</port>
									<port>15675:15675</port>
								</ports>
								<wait>
									<http>
										<url>http://${docker.host.address}:15672</url>
										<method>GET</method>
										<status>200..399</status>
									</http>
									<time>50000</time>
								</wait>
								<log>
									<prefix>rabbitmq</prefix>
									<color>magenta</color>
								</log>
							</run>
						</image>
					</images>
				</configuration>
				<executions>
					<execution>
						<id>start</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>build</goal>
							<goal>start</goal>
						</goals>
					</execution>
					<execution>
						<id>stop</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>stop</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.19.1</version>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.19.1</version>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<systemPropertyVariables>
						<brokerHostAddress>${docker.host.address}</brokerHostAddress>
					</systemPropertyVariables>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>1.4</version>
				<configuration>
					<licenseName>apache_v2</licenseName>
					<encoding>UTF-8</encoding>
					<processStartTag>#[license]</processStartTag>
					<sectionDelimiter>
					</sectionDelimiter>
					<processEndTag>%[license]</processEndTag>
					<roots>
						<root>src/main/java</root>
						<root>src/test/java</root>
					</roots>
					<excludes>
						<exclude>*.json</exclude>
						<exclude>*.properties</exclude>
						<exclude>*.xml</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>first</id>
						<goals>
							<goal>update-file-header</goal>
						</goals>
						<phase>process-sources</phase>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5.3</version>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings 
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.codehaus.mojo
										</groupId>
										<artifactId>
											license-maven-plugin
										</artifactId>
										<versionRange>
											[1.4,)
										</versionRange>
										<goals>
											<goal>
												update-file-header
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<profiles>
		<profile>
			<id>releaseBranchPrefix-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.4</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

</project>
