<?xml version="1.0" encoding="UTF-8"?>
<!--

	Copyright (c) 2013 mgm technology partners GmbH

	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 OR CONDITIONS OF ANY KIND, either express or implied.
	See the License 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>
	<parent>
		<groupId>org.sonatype.oss</groupId>
		<artifactId>oss-parent</artifactId>
		<version>7</version>
	</parent>
	<groupId>com.mgmtp.maven.poms</groupId>
	<artifactId>mgm-oss-parent</artifactId>
	<packaging>pom</packaging>
	<version>4</version>
	<name>mgm Maven OSS Parent POM</name>
	<description>mgm Maven OSS Parent POM</description>

	<organization>
		<name>mgm technology partners GmbH</name>
		<url>http://www.mgm-tp.com</url>
	</organization>

	<url>https://github.com/mgm-tp/mgm-oss-parent</url>

	<scm>
		<connection>scm:git:git://github.com/mgm-tp/mgm-oss-parent.git</connection>
		<developerConnection>scm:git:ssh://git@github.com/mgm-tp/mgm-oss-parent.git</developerConnection>
		<url>https://github.com/mgm-tp/mgm-oss-parent</url>
		<tag>mgm-oss-parent-4</tag>
	</scm>

	<distributionManagement>
		<snapshotRepository>
			<id>${repoId}</id>
			<name>snapshots</name>
			<url>${snapshotRepoUrl}</url>
		</snapshotRepository>
		<repository>
			<id>${repoId}</id>
			<name>releases</name>
			<url>${releaseRepoUrl}</url>
		</repository>
	</distributionManagement>

	<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>unguiculus</id>
			<name>Reinhard Nägele</name>
			<email>Reinhard.Naegele@mgm-tp.com</email>
			<organization>mgm technology partners GmbH</organization>
			<organizationUrl>http://www.mgm-tp.com</organizationUrl>
			<timezone>Europe/Berlin</timezone>
		</developer>
		<developer>
			<id>mvarendo</id>
			<name>Martin Varendorff</name>
			<email>Martin.Varendorff@mgm-tp.com</email>
			<organization>mgm technology partners GmbH</organization>
			<organizationUrl>http://www.mgm-tp.com</organizationUrl>
			<timezone>Europe/Berlin</timezone>
		</developer>
	</developers>

	<prerequisites>
		<maven>3.0</maven>
	</prerequisites>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>com.mycila.maven-license-plugin</groupId>
					<artifactId>maven-license-plugin</artifactId>
					<version>1.10.b1</version>
					<configuration>
						<header>${project.build.directory}/maven-shared-archive-resources/META-INF/copyright_header</header>
						<encoding>UTF-8</encoding>
						<strictCheck>true</strictCheck>
						<excludes>
							<exclude>**/*.txt</exclude>
							<exclude>.maven/**</exclude>
							<exclude>README.md</exclude>
							<exclude>LICENSE</exclude>
							<exclude>NOTICE</exclude>
							<exclude>**/*.log</exclude>
						</excludes>
						<mapping>
							<java>SLASHSTAR_STYLE</java>
							<groovy>SLASHSTAR_STYLE</groovy>
							<gradle>SLASHSTAR_STYLE</gradle>
							<gant>SLASHSTAR_STYLE</gant>
							<props>SCRIPT_STYLE</props>
						</mapping>
					</configuration>
				</plugin>
				<plugin>
					<!-- This tells m2e to ignore plugin executions in order to get rid of warnings in Eclipse. -->
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-enforcer-plugin</artifactId>
										<versionRange>[1.0,)</versionRange>
										<goals>
											<goal>enforce</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>com.mycila.maven-license-plugin</groupId>
										<artifactId>maven-license-plugin</artifactId>
										<versionRange>[1.0,)</versionRange>
										<goals>
											<goal>format</goal>
											<goal>check</goal>
											<goal>remove</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-remote-resources-plugin</artifactId>
										<versionRange>[1.4,)</versionRange>
										<goals>
											<goal>bundle</goal>
											<goal>process</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</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-compiler-plugin</artifactId>
					<version>3.1</version>
					<configuration>
						<source>1.6</source>
						<target>1.6</target>
						<showDeprecation>true</showDeprecation>
						<showWarnings>true</showWarnings>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>2.7</version>
					<configuration>
						<updateReleaseInfo>true</updateReleaseInfo>
						<retryFailedDeploymentCount>3</retryFailedDeploymentCount>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-install-plugin</artifactId>
					<version>2.4</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>2.4</version>
					<configuration>
						<archive>
							<manifest>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
								<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
							</manifest>
							<manifestEntries>
								<Implementation-Date>${timestamp}</Implementation-Date>
								<Implementation-Revision>${revision}</Implementation-Revision>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${javadoc.plugin.version}</version>
					<configuration>
						<archive>
							<manifest>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
								<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
							</manifest>
							<manifestEntries>
								<Implementation-Date>${timestamp}</Implementation-Date>
								<Implementation-Revision>${revision}</Implementation-Revision>
							</manifestEntries>
						</archive>
						<links>
							<link>http://docs.oracle.com/javase/6/docs/api/</link>
						</links>
						<bottom><![CDATA[Copyright (c) 2013 mgm technology partners GmbH]]></bottom>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>2.4.1</version>
					<configuration>
						<autoVersionSubmodules>true</autoVersionSubmodules>
						<suppressCommitBeforeBranch>true</suppressCommitBeforeBranch>
						<goals>deploy</goals>
						<preparationGoals>verify</preparationGoals>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-resources-plugin</artifactId>
					<version>2.6</version>
					<configuration>
						<delimiters>
							<delimiter>${*}</delimiter>
						</delimiters>
						<useDefaultDelimiters>false</useDefaultDelimiters>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>3.3</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${source.plugin.version}</version>
					<configuration>
						<archive>
							<manifest>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
								<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
							</manifest>
							<manifestEntries>
								<Implementation-Date>${timestamp}</Implementation-Date>
								<Implementation-Revision>${revision}</Implementation-Revision>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.15</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-war-plugin</artifactId>
					<version>2.4</version>
					<configuration>
						<archive>
							<manifest>
								<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
								<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
							</manifest>
							<manifestEntries>
								<Implementation-Date>${timestamp}</Implementation-Date>
								<Implementation-Revision>${revision}</Implementation-Revision>
							</manifestEntries>
						</archive>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>buildnumber-maven-plugin</artifactId>
				<version>1.2</version>
				<configuration>
					<buildNumberPropertyName>revision</buildNumberPropertyName>
					<timestampPropertyName>timestamp</timestampPropertyName>
					<timestampFormat>{0,date,yyyy-MM-dd'T'HH:mm:ssZZ}</timestampFormat>
					<getRevisionOnlyOnce>true</getRevisionOnlyOnce>
					<shortRevisionLength>7</shortRevisionLength>
				</configuration>
				<executions>
					<execution>
						<id>create-build-metadata</id>
						<phase>validate</phase>
						<goals>
							<goal>create</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-enforcer-plugin</artifactId>
				<version>1.3.1</version>
				<executions>
					<execution>
						<id>enforce-maven</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requireMavenVersion>
									<version>3</version>
								</requireMavenVersion>
							</rules>
						</configuration>
					</execution>
					<execution>
						<id>enforce-plugin-versions</id>
						<goals>
							<goal>enforce</goal>
						</goals>
						<configuration>
							<rules>
								<requirePluginVersions>
									<message>Versions for all plugins must be defined in pom.xml!</message>
								</requirePluginVersions>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-remote-resources-plugin</artifactId>
				<version>1.4</version>
				<executions>
					<execution>
						<id>include-license-resources</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>process</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<resourceBundles>
						<resourceBundle>com.mgmtp.maven.resources:mgm-oss-jar-resource-bundle:${mgm-oss-jar-resource-bundle.version}</resourceBundle>
					</resourceBundles>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-license-files-to-basedir</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<resources>
								<resource>
									<directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
									<filtering>false</filtering>
									<includes>
										<include>LICENSE</include>
										<include>NOTICE</include>
									</includes>
								</resource>
							</resources>
							<outputDirectory>${basedir}</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<!--
				Override plugin versions of Sonatype profile. This needs to be done
				here because profiles are not inherited.
			-->
			<id>sonatype-oss-release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>${source.plugin.version}</version>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${javadoc.plugin.version}</version>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>attachSources</id>
			<build>
				<plugins>
					<plugin>
						<artifactId>maven-source-plugin</artifactId>
						<executions>
							<execution>
								<id>source-jar</id>
								<phase>package</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>sonar</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.jacoco</groupId>
						<artifactId>jacoco-maven-plugin</artifactId>
						<version>${jacoco.version}</version>
						<executions>
							<execution>
								<id>prepare-jacoco-agent</id>
								<goals>
									<goal>prepare-agent</goal>
								</goals>
								<configuration>
									<destFile>${sonar.jacoco.reportPath}</destFile>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<properties>
				<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
				<sonar.surefire.reportsPath>${project.build.directory}/surefire-reports</sonar.surefire.reportsPath>
				<sonar.jacoco.reportPath>${project.build.directory}/jacoco-unit.exec</sonar.jacoco.reportPath>
				<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
			</properties>
		</profile>
		<profile>
			<id>add-license-headers</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.mycila.maven-license-plugin</groupId>
						<artifactId>maven-license-plugin</artifactId>
						<executions>
							<execution>
								<id>add-license</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>format</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>check-license-headers</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.mycila.maven-license-plugin</groupId>
						<artifactId>maven-license-plugin</artifactId>
						<executions>
							<execution>
								<id>check-license</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>check</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>remove-license-headers</id>
			<build>
				<plugins>
					<plugin>
						<groupId>com.mycila.maven-license-plugin</groupId>
						<artifactId>maven-license-plugin</artifactId>
						<executions>
							<execution>
								<id>remove-license</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>remove</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<jacoco.version>0.6.3.201306030806</jacoco.version>
		<source.plugin.version>2.2.1</source.plugin.version>
		<javadoc.plugin.version>2.9.1</javadoc.plugin.version>
		<mgm-oss-jar-resource-bundle.version>2</mgm-oss-jar-resource-bundle.version>
	</properties>
</project>
