<?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>com.entopix</groupId>
	<artifactId>maui-parent</artifactId>
	<version>1.1</version>
	<packaging>pom</packaging>
	<name>maui-parent</name>

	<description>
		This is the parent of the release and holds all of the functional definitions
		required for child projects to release.
	</description>

	<url>https://code.google.com/p/maui-indexer/</url>

	<developers>
		<developer>
			<email>alyona@entopixDOTcom</email>
			<id>zelandiya</id>
			<name>Alyona Medelyan</name>
			<organization>Entopix Ltd</organization>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>GNU GPL v3</name>
			<url>http://www.opensource.org/licenses/GPL-3.0</url>
		</license>
	</licenses>

	<scm>
		<connection>scm:git:git@github.com:zelandiya/maui.git</connection>
		<developerConnection>scm:git:git@github.com:zelandiya/maui</developerConnection>
		<url>git@github.com:zelandiya/maui.git</url>
		<tag>maui-parent-1.1</tag>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.version>3.2.2</maven.version>
		<maui.release>dev</maui.release> <!-- gets changed to release when releasing -->
	</properties>

	<!-- where it gets uploaded to -->
	<distributionManagement>
		<repository>
			<id>sonatype-staging</id>
			<name>oss.sonatype.org Staging Repository</name>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
		<snapshotRepository>
			<id>sonatype-snapshots</id>
			<name>oss.sonatype.org Snapshot Repository</name>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
		</snapshotRepository>
	</distributionManagement>

	<profiles>
		<profile>
			<!-- activate the sonatype profile when a release is being done, which is when you need to sign your build -->
			<id>sonatype</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.1</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<build>
		<plugins>
			<!-- gives us code coverage reports -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.6.5.201403032054</version>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
					<execution>
						<id>report</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>report</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- the source, javadoc, release-pom you can trigger only when you are releasing by moving them up to the profile above. -->

			<!-- attaches source to the released/installed artifact -->
			<plugin>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>package</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- required so we attach our docs -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.7</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- needed to make sure Git is used correctly at release -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-scm-plugin</artifactId>
				<version>1.9</version>
			</plugin>

			<!-- ensure certain rules are in place when we release -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.2</version>
				<configuration>
					<rules>
						<requireMavenVersion>
							<version>[3.2.2,)</version>
						</requireMavenVersion>
						<requireReleaseDeps>
							<!--  Don't allow releases with snapshop deps or parents -->
							<message>No Snapshots Allowed!</message>
							<failWhenParentIsSnapshot>true</failWhenParentIsSnapshot>
							<searchTransitive>true</searchTransitive>
						</requireReleaseDeps>
						<!-- Don't allow accidental inclusion of commons logging or log4j -->
						<bannedDependencies>
							<excludes>
								<exclude>commons-logging</exclude>
								<exclude>commons-logging-api</exclude>
							</excludes>
						</bannedDependencies>
					</rules>
					<fail>true</fail>
				</configuration>
			</plugin>

			<!-- configure the release plugin -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-release-plugin</artifactId>
				<version>2.5</version>
				<configuration>
					<mavenExecutorId>forked-path</mavenExecutorId>
					<arguments>-Dmaui.release=release</arguments>
					<preparationGoals>clean enforcer:enforce verify</preparationGoals>
					<goals>enforcer:enforce deploy</goals>
					<tagBase>release/${project.groupId}/</tagBase>
					<pushChanges>false</pushChanges>
					<localCheckout>true</localCheckout>
				</configuration>
			</plugin>

			<!-- ensure we are using the latest compiler plugin and we are targeting JDK 1.6 -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.1</version>
				<configuration>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
