<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">

	<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
		contributor license agreements. See the NOTICE file distributed with this 
		work for additional information regarding copyright ownership. The ASF licenses 
		this file to You 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. -->

	<modelVersion>4.0.0</modelVersion>
	<groupId>ch.sourcepond</groupId>
	<artifactId>build</artifactId>
	<version>0.2.0</version>
	<packaging>pom</packaging>
	<name>Base build POM</name>
	<inceptionYear>2015</inceptionYear>
	<description>
		Base project object model for all projects published by SourcePond.
	</description>

	<properties>
		<!-- Plugin versions -->
		<maven-jar-plugin.version>2.6</maven-jar-plugin.version>
		<maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
		<maven-failsafe-plugin.version>2.19</maven-failsafe-plugin.version>
		<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
		<sisu-maven-plugin.version>0.3.2</sisu-maven-plugin.version>
		<jacoco-maven-plugin.version>0.7.5.201505241946</jacoco-maven-plugin.version>
		<maven-source-plugin.version>2.4</maven-source-plugin.version>
		<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
		<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
		<maven-site-plugin.version>3.4</maven-site-plugin.version>
		<maven-project-info-reports-plugin.version>2.8.1</maven-project-info-reports-plugin.version>
		<github.site-maven-plugin.version>0.12</github.site-maven-plugin.version>
		<maven-release-plugin.version>2.5.3</maven-release-plugin.version>

		<!-- Dependency versions -->
		<slf4j-api.version>1.7.12</slf4j-api.version>
		<geronimo-atinject_1.0_spec.version>1.0</geronimo-atinject_1.0_spec.version>
		<commons-lang3.version>3.4</commons-lang3.version>
		<commons-codec.version>1.10</commons-codec.version>
		<junit.version>4.12</junit.version>
		<mockito.version>2.0.2-beta</mockito.version>
		<objenesis.version>2.2</objenesis.version>
		<javassist.version>3.20.0-GA</javassist.version>
		<asm.version>5.0.4</asm.version>
		<guice.version>4.0</guice.version>
		<guava.version>19.0-rc2</guava.version>

		<!-- Project encoding -->
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>

		<!-- Compiler configuration -->
		<common.encoding>UTF-8</common.encoding>
		<javaVersion>1.7</javaVersion>

		<!-- Configuration for SCM, Build-Server and remote Maven Repository -->
		<jenkins.baseurl>https://sourcepond.ci.cloudbees.com</jenkins.baseurl>
		<deployment.baseurl>https://oss.sonatype.org</deployment.baseurl>
		<git.url>https://github.com/SourcePond/${project.artifactId}</git.url>
		<git.protocol.url>scm:git:${git.url}.git</git.protocol.url>
		<project.scm.id>github</project.scm.id>
	</properties>

	<url>${git.url}</url>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>${slf4j-api.version}</version>
			</dependency>
			<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.apache.geronimo.specs</groupId>
				<artifactId>geronimo-atinject_1.0_spec</artifactId>
				<version>${geronimo-atinject_1.0_spec.version}</version>
			</dependency>
			<dependency>
				<groupId>org.javassist</groupId>
				<artifactId>javassist</artifactId>
				<version>${javassist.version}</version>
			</dependency>
			<dependency>
				<groupId>org.ow2.asm</groupId>
				<artifactId>asm-all</artifactId>
				<version>${asm.version}</version>
			</dependency>
			<dependency>
				<groupId>com.google.guava</groupId>
				<artifactId>guava</artifactId>
				<version>${guava.version}</version>
			</dependency>

			<!-- Testing -->
			<dependency>
				<scope>test</scope>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>${junit.version}</version>
			</dependency>
			<dependency>
				<scope>test</scope>
				<groupId>org.mockito</groupId>
				<artifactId>mockito-core</artifactId>
				<version>${mockito.version}</version>
			</dependency>
			<dependency>
				<scope>test</scope>
				<groupId>org.objenesis</groupId>
				<artifactId>objenesis</artifactId>
				<version>${objenesis.version}</version>
			</dependency>
			<dependency>
				<scope>test</scope>
				<groupId>com.google.inject</groupId>
				<artifactId>guice</artifactId>
				<version>${guice.version}</version>
				<exclusions>
					<exclusion>
						<artifactId>javax.inject</artifactId>
						<groupId>javax.inject</groupId>
					</exclusion>
				</exclusions>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<dependencies>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
		</dependency>
		<dependency>
			<groupId>com.google.guava</groupId>
			<artifactId>guava</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.geronimo.specs</groupId>
			<artifactId>geronimo-atinject_1.0_spec</artifactId>
		</dependency>

		<!-- Testing -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.objenesis</groupId>
			<artifactId>objenesis</artifactId>
		</dependency>
	</dependencies>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-deploy-plugin</artifactId>
					<version>${maven-deploy-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>${maven-jar-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire-plugin.version}</version>
					<dependencies>
						<dependency>
							<groupId>org.apache.maven.surefire</groupId>
							<!-- Use the older JUnit 4 provider -->
							<artifactId>surefire-junit47</artifactId>
							<version>${maven-surefire-plugin.version}</version>
						</dependency>
					</dependencies>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>${maven-failsafe-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco-maven-plugin.version}</version>
					<executions>
						<!-- Prepares the property pointing to the JaCoCo runtime agent which 
							is passed as VM argument when Maven the Surefire plugin is executed. -->
						<execution>
							<id>pre-unit-test</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
							<configuration>
								<!-- Sets the path to the file which contains the execution data. -->
								<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
							</configuration>
						</execution>
						<!-- Ensures that the code coverage report for unit tests is created 
							after unit tests have been run. -->
						<execution>
							<id>post-unit-test</id>
							<phase>test</phase>
							<goals>
								<goal>report</goal>
							</goals>
							<configuration>
								<!-- Sets the path to the file which contains the execution data. -->
								<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
								<!-- Sets the output directory for the code coverage report. -->
								<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-source-plugin</artifactId>
					<version>${maven-source-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-javadoc-plugin</artifactId>
					<version>${maven-javadoc-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<encoding>${common.encoding}</encoding>
						<source>${javaVersion}</source>
						<target>${javaVersion}</target>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>${maven-gpg-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-site-plugin</artifactId>
					<version>${maven-site-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-project-info-reports-plugin</artifactId>
					<version>${maven-project-info-reports-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>com.github.github</groupId>
					<artifactId>site-maven-plugin</artifactId>
					<version>${github.site-maven-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>${maven-release-plugin.version}</version>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>com.github.github</groupId>
				<artifactId>site-maven-plugin</artifactId>
				<configuration>
					<message>Creating site for ${project.artifactId} /
						${project.version}</message>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>site</goal>
						</goals>
						<phase>site</phase>
						<configuration>
							<server>github</server>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<!-- Profile for running release builds -->
		<profile>
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-release-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>

	<scm>
		<url>${git.url}</url>
		<connection>${git.protocol.url}</connection>
		<developerConnection>${git.protocol.url}</developerConnection>
		<tag>build-0.2.0</tag>
	</scm>

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

	<ciManagement>
		<url>${jenkins.baseurl}</url>
		<system>Jenkins</system>
	</ciManagement>

	<distributionManagement>
		<repository>
			<id>ossrh-stage</id>
			<name>SourcePond Stage Repository</name>
			<url>${deployment.baseurl}/service/local/staging/deploy/maven2/</url>
		</repository>
		<snapshotRepository>
			<id>ossrh-snapshot</id>
			<name>SourcePond Snapshot Repository</name>
			<url>${deployment.baseurl}/content/repositories/snapshots</url>
		</snapshotRepository>
	</distributionManagement>

	<developers>
		<developer>
			<id>sourcepond</id>
			<name>Roland Hauser</name>
			<organization>SourcePond</organization>
			<timezone>+1</timezone>
			<email>sourcepond@gmail.com</email>
		</developer>
	</developers>

</project>