<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright © Microsoft Open Technologies, Inc.

    All Rights Reserved

    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

    THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
    OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
    ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A
    PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.

    See the Apache License, Version 2.0 for the specific language
    governing permissions and limitations under the License.

-->
<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>
	<packaging>pom</packaging>
	<groupId>com.microsoft.office</groupId>
	<artifactId>mail-calendar-contact-parent</artifactId>
	<version>1.0</version>
	<name>Microsoft Office 365 Mail-Calendar-Contact SDK for Java Parent Configuration</name>
	<description>Java SDK for Office 365 Mail-Calendar-Contact services: Parent</description>

	<url>https://github.com/OfficeDev/Office-365-SDK-for-Android</url>

	<inceptionYear>2014</inceptionYear>

	<organization>
		<name>MS OpenTech</name>
		<url>http://msopentech.com/</url>
	</organization>

	<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>mkostin</id>
			<name>Maxim Kostin</name>
			<email>dev@maxkostin.ru</email>
		</developer>
		<developer>
			<id>maxmironov</id>
			<name>Maxim Mironov</name>
			<email>maksim.mironov@akvelon.com</email>
		</developer>
	</developers>

	<scm>
		<url>https://github.com/OfficeDev/Office-365-SDK-for-Android/tree/master/sdk/office365-mail-calendar-contact-sdk</url>
		<connection>scm:git:git://github.com/OfficeDev/Office-365-SDK-for-Android.git</connection>
		<developerConnection>scm:git:https://github.com/OfficeDev/Office-365-SDK-for-Android.git</developerConnection>
	</scm>

	<distributionManagement>
		<snapshotRepository>
			<id>snapshot-repo</id>
			<name>Sonatype Nexus Snapshots</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>release-repo</id>
			<name>Nexus Release Repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

	<prerequisites>
		<maven>[3.0.3,)</maven>
	</prerequisites>

	<properties>
		<maven.javadoc.skip>true</maven.javadoc.skip>
		<source.skip>true</source.skip>
		<maven.site.skip>false</maven.site.skip>

		<targetJdk>1.6</targetJdk>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

		<hc.client.version>4.2.6</hc.client.version>

		<commons.lang3.version>3.2.1</commons.lang3.version>
		<commons.codec.version>1.9</commons.codec.version>

		<sl4j.version>1.7.5</sl4j.version>

		<proguard.version>4.8</proguard.version>

		<main.basedir>${project.basedir}</main.basedir>

		<serviceRootURL>https://outlook.office365.com/ews/odata</serviceRootURL>
		<serviceUsername>Enter your username here</serviceUsername>
		<servicePassword>Enter your password here</servicePassword>

		<skip.tests>true</skip.tests>
	</properties>

	<dependencyManagement>
		<dependencies>

			<dependency>
				<groupId>org.apache.commons</groupId>
				<artifactId>commons-lang3</artifactId>
				<version>${commons.lang3.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-codec</groupId>
				<artifactId>commons-codec</artifactId>
				<version>${commons.codec.version}</version>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${sl4j.version}</version>
			</dependency>
			<dependency>
				<groupId>commons-logging</groupId>
				<artifactId>commons-logging</artifactId>
				<version>1.1.1</version>
				<scope>provided</scope>
			</dependency>

			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>16.0.1</version>
				<scope>compile</scope>
			</dependency>

			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-simple</artifactId>
				<version>${sl4j.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.11</version>
				<scope>test</scope>
			</dependency>

		</dependencies>
	</dependencyManagement>

	<build>

		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.1</version>
					<configuration>
						<source>${targetJdk}</source>
						<target>${targetJdk}</target>
						<showWarnings>true</showWarnings>
						<showDeprecation>true</showDeprecation>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>1.3.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-plugin-plugin</artifactId>
					<version>3.2</version>
				</plugin>

				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>jarjar-maven-plugin</artifactId>
					<version>1.8</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-invoker-plugin</artifactId>
					<version>1.8</version>
				</plugin>

				<!-- e2e SDK tests -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.16</version>
					<configuration>
						<skipTests>${skip.tests}</skipTests>
						<redirectTestOutputToFile>true</redirectTestOutputToFile>
						<encoding>utf-8</encoding>
						<runOrder>alphabetical</runOrder>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>exec-maven-plugin</artifactId>
					<version>1.2.1</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>2.2</version>
					<configuration>
						<shadedArtifactAttached>false</shadedArtifactAttached>
						<createDependencyReducedPom>true</createDependencyReducedPom>
						<minimizeJar>false</minimizeJar>
						<filters>
							<filter>
								<artifact>*:*</artifact>
								<excludes>
									<exclude>**/test/**</exclude>
								</excludes>
							</filter>
							<filter>
								<artifact>com.google.guava:guava</artifact>
								<includes>
									<include>com/google/common/util/concurrent/**</include>
									<include>com/google/common/base/**</include>
									<include>com/google/common/annotations/**</include>
									<include>com/google/common/collect/**</include>
								</includes>
							</filter>
						</filters>
						<artifactSet>
							<includes>
								<include>commons-beanutils:commons-beanutils-core</include>
								<include>commons-io:commons-io</include>
								<include>com.microsoft.office:**</include>
								<include>com.fasterxml.jackson.core:jackson-databind</include>
								<include>com.fasterxml.jackson.core:jackson-annotations</include>
								<include>com.fasterxml.jackson.core:jackson-core</include>
								<include>com.thoughtworks.xstream:xstream</include>
								<include>org.apache.commons:commons-lang3</include>
								<include>org.slf4j:slf4j-api</include>
								<include>com.google.guava:guava</include>
							</includes>
							<excludes>
								<exclude>com.microsoft.office:mail-calendar-contact-maven-plugin</exclude>
							</excludes>
						</artifactSet>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-clean-plugin</artifactId>
					<version>2.5</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>2.16</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<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>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9.1</version>
				<executions>
					<execution>
						<id>javadoc-jar</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-deploy-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<inherited>true</inherited>
				<executions>
					<execution>
						<id>enforce-serviceRootURL-property</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireProperty>
									<property>serviceRootURL</property>
									<message>You must set 'serviceRootURL' property!</message>
									<regex>http(s)?://.*</regex>
									<regexMessage>The serviceRootURL property must be a valid HTTP(S) URL.</regexMessage>
								</requireProperty>
							</rules>
							<fail>true</fail>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Manage licensing -->
			<plugin>
				<groupId>com.mycila.maven-license-plugin</groupId>
				<artifactId>maven-license-plugin</artifactId>
				<version>1.10.b1</version>
				<configuration>
					<header>${main.basedir}/../src/main/resources/header.txt</header>
					<strictCheck>true</strictCheck>
					<failIfMissing>false</failIfMissing>
					<aggregate>true</aggregate>
					<useDefaultExcludes>true</useDefaultExcludes>
					<useDefaultMapping>true</useDefaultMapping>
					<excludes>
						<exclude>LICENSE</exclude>
						<exclude>nb*.xml</exclude>
						<exclude>**/META-INF/services/**</exclude>
						<exclude>**/META-INF/MANIFEST.MF</exclude>
						<exclude>**/*.css</exclude>
						<exclude>**/*.js</exclude>
						<exclude>**/*.json</exclude>
						<exclude>**/*.csv</exclude>
						<exclude>**/*.txt</exclude>
						<exclude>**/*.xls</exclude>
						<exclude>**/build-copy-javadoc-files.xml</exclude>
						<exclude>**/maven-eclipse.xml</exclude>
						<exclude>**/*.iml</exclude>
						<exclude>**/*.log</exclude>
						<exclude>.externalToolBuilders/**</exclude>
						<exclude>.git/**</exclude>
						<exclude>.idea/**</exclude>
						<exclude>**/.*</exclude>
						<exclude>yworks*/**</exclude>
						<exclude>*.json</exclude>
						<exclude>**/generated-sources/**</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>check-headers</id>
						<phase>verify</phase>
						<goals>
							<goal>check</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Put LICENSE file in all javadoc artifacts -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<executions>
					<execution>
						<id>copy-javadoc-legal-files</id>
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/apidocs/META-INF</outputDirectory>
							<resources>
								<resource>
									<directory>..</directory>
									<includes>
										<include>LICENSE</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>


	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.0</version>
				<configuration>
					<stagingDirectory>${basedir}\target\stage</stagingDirectory>
					<reportPlugins>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-project-info-reports-plugin</artifactId>
							<version>2.4</version>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-javadoc-plugin</artifactId>
							<version>2.8</version>
							<reportSets>
								<reportSet>
									<id>non-aggregate</id>
									<reports>
										<report>javadoc</report>
									</reports>
								</reportSet>
								<reportSet>
									<id>aggregate</id>
									<inherited>false</inherited>
									<reports>
										<report>aggregate</report>
									</reports>
								</reportSet>
							</reportSets>
						</plugin>
						<plugin>
							<groupId>org.apache.maven.plugins</groupId>
							<artifactId>maven-surefire-report-plugin</artifactId>
							<version>2.6</version>
						</plugin>
					</reportPlugins>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
				<version>2.4</version>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<version>3.0.1</version>
				<configuration>
					<linkXref>true</linkXref>
					<sourceEncoding>utf-8</sourceEncoding>
					<minimumTokens>100</minimumTokens>
					<targetJdk>${targetJdk}</targetJdk>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
				<version>2.3</version>
				<reportSets>
					<reportSet>
						<id>aggregate</id>
						<inherited>false</inherited>
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<reportSets>
					<reportSet>
						<id>aggregate</id>
						<inherited>false</inherited>
						<reports>
							<report>aggregate</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>findbugs-maven-plugin</artifactId>
				<version>2.5.2</version>
				<configuration>
					<!-- Set to 'low' if you run out of memory -->
					<effort>Max</effort>
					<!-- Reports all bugs (other values are medium and max) -->
					<threshold>Low</threshold>
					<!-- Produces XML report -->
					<xmlOutput>true</xmlOutput>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<profile>
			<id>e2eTests</id>
			<properties>
				<skip.tests>false</skip.tests>
			</properties>
			<build>
				<defaultGoal>clean package</defaultGoal>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<inherited>true</inherited>
						<executions>
							<execution>
								<id>enforce-property</id>
								<goals>
									<goal>enforce</goal>
								</goals>
								<configuration>
									<rules>
										<requireProperty>
											<property>serviceRootURL</property>
											<message>You must set 'serviceRootURL' property!</message>
											<regex>http(s)?://.*</regex>
											<regexMessage>The serviceRootURL property must be a valid HTTP(S) URL.</regexMessage>
										</requireProperty>
									</rules>
									<fail>true</fail>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
