<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>com.ibm.wiotp</groupId>
    <artifactId>com.ibm.wiotp.sdk</artifactId>
    <version>0.4.0</version>
    <packaging>jar</packaging>

	<!--
	To publish a new release:
		mvn versions:set -DnewVersion=0.1.0
		mvn clean install
		mvn deploy -P sign-artifacts
	-->
    <name>IBM Watson IoT SDK</name>
    <description>IBM Watson IoT Platform clients to simplify device, gateway, and application development</description>
    <url>https://github.com/ibm-watson-iot/iot-java</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <gson-version>2.8.1</gson-version>
        <paho-version>1.2.2</paho-version>
        <junit-version>4.12</junit-version>
		
        <runSuite>**/AllTestSuite.class</runSuite>
    </properties>
    
    <scm>
        <url>https://github.com/ibm-watson-iot/iot-java</url>
        <connection>scm:git:git@github.com:ibm-watson-iot/iot-java.git</connection>
        <developerConnection>scm:git:git@github.com:ibm-watson-iot/iot-java.git</developerConnection>
    </scm>

    <issueManagement>
        <url>https://github.com/ibm-watson-iot/iot-java/issues</url>
        <system>Issues @ GitHub</system>
    </issueManagement>

    <licenses>
        <license>
            <name>Eclipse Public License - v 1.0</name>
            <url>https://github.com/ibm-watson-iot/iot-java/blob/master/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>David Parker</name>
            <email>parkerda@uk.ibm.com</email>
            <organization>IBM</organization>
            <organizationUrl>https://internetofthings.ibmcloud.com</organizationUrl>
        </developer>
    </developers>

	<!-- See: https://central.sonatype.org/pages/apache-maven.html -->
	<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>

	<repositories>
		<repository>
			<id>Sonatype-public</id>
			<name>Sonatype repository</name>
			<url>http://oss.sonatype.org/content/groups/public/</url>
		</repository>
	</repositories>
	
    <dependencies>
        <dependency>
            <groupId>com.ibm.wiotp</groupId>
            <artifactId>com.ibm.wiotp.sdk.swagger</artifactId>
            <version>0.1.0</version>
        </dependency>
        
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson-version}</version>
        </dependency>
        <dependency>
            <groupId>org.eclipse.paho</groupId>
            <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
            <version>${paho-version}</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.13</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.9</version>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.10.5</version>
        </dependency>
        
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
        	<groupId>org.slf4j</groupId>
        	<artifactId>slf4j-api</artifactId>
        	<version>1.7.29</version>
        </dependency>

		<dependency>
   			<groupId>org.yaml</groupId>
   			<artifactId>snakeyaml</artifactId>
  			<version>1.25</version>
 		</dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Launch the tests -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.2</version>
				<configuration>
					 <parallel>classes</parallel>
					 <threadCount>100</threadCount>
					 <includes>
					 	<include>${runSuite}</include>
					 </includes>
				</configuration>
			</plugin>

            <!-- Generate a code coverage report from the tests -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.5</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <!-- 
                Submit code coverage report to coveralls.io
                https://coveralls.io/github/ibm-watson-iot/iot-java

                See: https://github.com/trautonen/coveralls-maven-plugin 
            -->
            <plugin>
                <groupId>org.eluder.coveralls</groupId>
                <artifactId>coveralls-maven-plugin</artifactId>
                <version>4.3.0</version>
                <configuration>
                    <repoToken>${env.COVERALLS_TOKEN}</repoToken>
                </configuration>
            </plugin>

            <!-- Configure compiler options -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <compilerArgs>
                    	<args>-Xlint:unchecked</args>
                    	<args>-Xlint:deprecation</args>                    	
                    </compilerArgs>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>jar</goal>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.10</version>
                <executions>
                    <execution>
                        <id>add_sources</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/java</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add_test_sources</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/java</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </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>
        									build-helper-maven-plugin
        								</artifactId>
        								<versionRange>
        									[1.10,)
        								</versionRange>
        								<goals>
        									<goal>add-source</goal>
        									<goal>add-test-source</goal>
        								</goals>
        							</pluginExecutionFilter>
        							<action>
        								<ignore></ignore>
        							</action>
        						</pluginExecution>
        					</pluginExecutions>
        				</lifecycleMappingMetadata>
        			</configuration>
        		</plugin>
        	</plugins>
        </pluginManagement>
    </build>
    
    <profiles>
        <profile>
            <id>sign-artifacts</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

