<?xml version="1.0"?>
<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>nz.net.osnz.parent</groupId>
	<artifactId>central-parent</artifactId>
	<version>3.3</version>
	<packaging>pom</packaging>

	<name>Open Source New Zealand - Central Parent</name>
	<description>
		Packaging parent for OSNZ.NET Maven projects.
		Defines rules for all projects packaging in this github fork.
		The release plugin will need to be overridden for each project so it maintains the correct structure for Github.
	</description>
	<url>https://github.com/kdeng/central-parent</url>

	<licenses>
		<license>
			<name>MIT License</name>
			<url>http://www.opensource.org/licenses/mit-license.php</url>
		</license>
	</licenses>

	<developers>
		<developer>
			<name>Kefeng Deng</name>
			<email>deng@51any.com</email>
		</developer>
	</developers>

	<scm>
		<!-- This setting will be replaced by the maven-release-plugin -->
		<url>https://github.com/kdeng/central-parent</url>
		<connection>scm:git:git@github.com/kdeng/central-parent.git</connection>
		<developerConnection>scm:git:git@github.com:kdeng/central-parent.git</developerConnection>
		<tag>central-parent-3.3</tag>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<distributionManagement>
		<repository>
			<id>sonatype-staging</id>
			<name>oss.sonatype.org Staging Repository</name>
			<url>http://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>
			<id>sonaytpe</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.6</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<!-- make sure source and javadocs are included in artifacts on release -->
	<build>
		<pluginManagement>
			<plugins>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>1.3.1</version>
					<!-- Invocation is defined by the release plugin goal set hence no executions -->
					<configuration>
						<rules>
							<requireMavenVersion>
								<version>[3.2.1,)</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>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-scm-plugin</artifactId>
					<version>1.9.2</version>
				</plugin>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.5.1</version>
					<configuration>
						<mavenExecutorId>forked-path</mavenExecutorId>
						<arguments>-Dbts.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>

				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.2</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>

				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>build-helper-maven-plugin</artifactId>
					<version>1.9.1</version>
				</plugin>

				<!--
				 these just have their versions specified, because we are in plugin management
				-->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>2.10.1</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.8.2</version>
				</plugin>

			</plugins>
		</pluginManagement>
	</build>

</project>
