<!--
  ~ Copyright 2013-2015 Guardtime, Inc.
  ~
  ~ This file is part of the Guardtime client SDK.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License").
  ~ You may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES, CONDITIONS, OR OTHER LICENSES OF ANY KIND, either
  ~ express or implied. See the License for the specific language governing
  ~ permissions and limitations under the License.
  ~ "Guardtime" and "KSI" are trademarks or registered trademarks of
  ~ Guardtime, Inc., and no license to trademarks is granted; Guardtime
  ~ reserves and retains all trademark rights.
  -->

<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.guardtime</groupId>
	<artifactId>ksi</artifactId>
	<version>4.3.54</version>
	<packaging>pom</packaging>

	<name>KSI SDK</name>
	<description>Keyless Signature Infrastructure (KSI) SDK for Java</description>
	<url>https://guardtime.com/ksi-technology</url>

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

	<developers>
		<developer>
			<name>Guardtime</name>
			<email>support@guardtime.com</email>
			<organization>Guardtime</organization>
			<organizationUrl>https://guardtime.com/</organizationUrl>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git@github.com:GuardTime/ksi-java-sdk</connection>
		<developerConnection>scm:git:git@github.com:GuardTime/ksi-java-sdk</developerConnection>
		<url>git@github.com:GuardTime/ksi-java-sdk</url>
	</scm>

	<modules>
		<module>ksi-common</module>
		<module>ksi-service-client</module>
		<module>ksi-service-client-common-http</module>
		<module>ksi-service-client-simple-http</module>
		<module>ksi-service-client-apache-http</module>
		<module>ksi-service-client-tcp</module>
		<module>ksi-api</module>
		<module>ksi-blocksigner</module>
	</modules>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<slf4j.version>1.7.12</slf4j.version>
		<bouncycastle.version>1.52</bouncycastle.version>
		<jacoco.version>0.7.5.201505241946</jacoco.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>1.7.12</version>
				<scope>provided</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<plugins>

			<!-- Compiler plugin & configuration -->
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.5</source>
					<target>1.5</target>
				</configuration>
			</plugin>

			<!-- Enforcer plugin & configuration. Minimum maven version is 3.1.1 -->
			<plugin>
				<inherited>true</inherited>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<id>enforce-maven-3</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3.1.1</version>
								</requireMavenVersion>
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.10</version>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<!-- Test coverage plugin & configuration -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>${jacoco.version}</version>
				<executions>
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
							<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
						</configuration>
					</execution>


					<execution>
						<id>pre-integration-test</id>
						<phase>pre-integration-test</phase>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
							<propertyName>failsafeArgLine</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>post-integration-test</id>
						<phase>post-integration-test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
							<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Unit test plugin & configuration -->
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.17</version>
				<executions>
					<execution>
						<id>default-test</id>
						<phase>test</phase>
						<goals>
							<goal>test</goal>
						</goals>
						<configuration>
							<argLine>${surefireArgLine}</argLine>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<argLine>-XX:MaxPermSize=512m</argLine>
					<excludes>
						<exclude>**/*IntegrationTest.java</exclude>
					</excludes>
				</configuration>
			</plugin>

			<!-- Integration test plugin & configuration -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>2.18</version>
				<configuration>
					<includes>
						<include>**/*IntegrationTest.java</include>
					</includes>
				</configuration>
				<executions>
					<execution>
						<id>integration-tests</id>
						<goals>
							<goal>integration-test</goal>
							<goal>verify</goal>
						</goals>
						<configuration>
							<argLine>${failsafeArgLine}</argLine>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.3</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<overview>${basedir}/ksi-api/src/main/javadoc/overview.html</overview>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.4</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.jacoco</groupId>
										<artifactId>jacoco-maven-plugin</artifactId>
										<versionRange>${jacoco.version}</versionRange>
										<goals>
											<goal>prepare-agent</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<!-- m2e doesn't know what to do with jacoco, let's ignore it or annoying error markers appear see http://wiki.eclipse.org/M2E_plugin_execution_not_covered -->
										<ignore></ignore>
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-checkstyle-plugin</artifactId>
					<version>2.15</version>
					<configuration>
						<configLocation>checkstyle.xml</configLocation>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.10.3</version>
					<configuration>
						<failOnError>false</failOnError>
						<footer><![CDATA[Copyright 2008-2016 Guardtime, Inc]]></footer>
						<additionalparam>${javadoc.doclint.none}</additionalparam>
						<quiet>true</quiet>
						<aggregate>true</aggregate>
					</configuration>
				</plugin>
				<plugin>
					<groupId>com.fortify.ps.maven.plugin</groupId>
					<artifactId>sca-maven-plugin</artifactId>
					<version>4.10</version>

				</plugin>
			</plugins>

		</pluginManagement>
	</build>

	<reporting>
		<plugins>
			<!-- Findbugs configuration -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>3.0.1</version>
				<configuration>
					<threshold>Normal</threshold>
					<omitVisitors>FindHEmismatch,FindReturnRef</omitVisitors>
					<xmlOutput>true</xmlOutput>
					<xmlOutputDirectory>target/site</xmlOutputDirectory>
				</configuration>
			</plugin>
			<!-- Checkstyle configuration -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
				<version>2.15</version>
				<configuration>
					<includeTestResources>false</includeTestResources>
					<configLocation>checkstyle.xml</configLocation>
				</configuration>
			</plugin>
			<!-- Javadoc configuration -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.3</version>
				<configuration>
					<failOnError>false</failOnError>
					<footer><![CDATA[Copyright 2008-2016 Guardtime, Inc]]></footer>
					<additionalparam>${javadoc.doclint.none}</additionalparam>
					<quiet>true</quiet>
					<aggregate>true</aggregate>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

	<organization>
		<url>https://guardtime.com/</url>
		<name>Guardtime</name>
	</organization>

	<repositories>
		<repository>
			<id>gt-public</id>
			<url>http://maven.ee.guardtime.com:8081/nexus/content/groups/public/</url>
		</repository>
	</repositories>

	<distributionManagement>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
		<snapshotRepository>
			<id>gt-snapshots</id>
			<url>http://maven.ee.guardtime.com:8081/nexus/content/repositories/snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

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

</project>
