<?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>org.bytemechanics</groupId>
	<artifactId>bytemechanics-maven</artifactId>
	<version>1.0.9</version>
	<packaging>pom</packaging>
	<name>ByteMechanics-Maven</name>
	<url>http://www.bytemechanics.org</url>
	<developers>
		<developer>
			<name>Albert Farré Figueras</name>
			<email>afarre@gmail.com</email>
			<url>https://www.linkedin.com/in/albert-farré-figueras-4348aa2</url>
			<roles>
				<role>Developer</role>
				<role>Product owner</role>
			</roles>
			<timezone>GMT+1</timezone>
		</developer>
	</developers>
	<licenses>
		<license>
			<name>Apache License 2.0</name>
			<url>http://opensource.org/licenses/Apache-2.0</url>
		</license>
	</licenses>
	<description>Standalone open source libraries for java commoners</description>
	<organization>
		<name>Byte Mechanics</name>
		<url>http://www.bytemechanics.org</url>
	</organization>
	<scm>
		<connection>https://github.com/bytemechanics/bytemecanics-maven.git</connection>
		<url>https://github.com/bytemechanics/bytemecanics-maven</url>
	</scm>
	
	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>		
	
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>1.8</maven.compiler.source>
		<maven.compiler.target>1.8</maven.compiler.target>
		<tests.skip>false</tests.skip>
	</properties>
			
	<dependencies>
		<!-- Mandatory dependencies for using Spock -->
		<dependency>
			<groupId>org.spockframework</groupId>
			<artifactId>spock-core</artifactId>
			<version>1.1-groovy-2.4</version>
			<exclusions>
				<exclusion>
					<groupId>org.codehaus.groovy</groupId>
					<artifactId>groovy-all</artifactId>								
				</exclusion>
			</exclusions>
			<scope>test</scope>
		</dependency>
		<!-- Optional dependencies for using Spock -->
		<dependency> <!-- use a specific Groovy version rather than the one specified by spock-core -->
			<groupId>org.codehaus.groovy</groupId>
			<artifactId>groovy-all</artifactId>
			<version>2.4.13</version>
			<scope>test</scope>
		</dependency>
		<dependency> <!-- enables mocking of classes (in addition to interfaces) -->
			<groupId>net.bytebuddy</groupId>
			<artifactId>byte-buddy</artifactId>
			<version>1.7.9</version>
			<scope>test</scope>
		</dependency>
		<dependency> <!-- enables mocking of classes without default constructor (together with CGLIB) -->
			<groupId>org.objenesis</groupId>
			<artifactId>objenesis</artifactId>
			<version>2.6</version>
			<scope>test</scope>
		</dependency>
		<dependency> <!-- enables mocking of classes without default constructor (together with objenesis) -->
			<groupId>cglib</groupId>
			<artifactId>cglib</artifactId>
			<version>3.2.8</version>
			<scope>test</scope>
		</dependency>	
	</dependencies>


	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-jar-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<execution>
							<goals>
								<goal>test-jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<!-- Mandatory plugins for using Spock -->
				<plugin>
					<!-- The gmavenplus plugin is used to compile Groovy code. To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
					<groupId>org.codehaus.gmavenplus</groupId>
					<artifactId>gmavenplus-plugin</artifactId>
					<version>1.5</version>
					<executions>
						<execution>
							<goals>
								<goal>addTestSources</goal>
								<goal>testCompile</goal>
							</goals>
						</execution>
					</executions>
				</plugin>			
				<!-- Optional plugins for using Spock -->
				<!-- Only required if names of spec classes don't match default Surefire patterns (`*Test` etc.) -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>2.22.0</version>
					<configuration>
						<useFile>false</useFile>
						<skipTests>${tests.skip}</skipTests>
						<includes>
							<include>**/*Spec*.*</include>
							<include>**/*Test*.*</include>
						</includes>
					</configuration>
				</plugin>		
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.8.2</version>
					<configuration>
						<output>file</output>
						<append>true</append>
					</configuration>
					<executions>
						<execution>
							<id>jacoco-initialize</id>
							<goals>
								<goal>prepare-agent</goal>
							</goals>
						</execution>
						<execution>
							<id>jacoco-site</id>
							<phase>verify</phase>
							<goals>
								<goal>report</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.6</version>
					<configuration>
						<keyname>BBA8B05B</keyname>
					</configuration>
					<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>3.0.1</version>
					<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>
					<version>3.0.1</version>
					<configuration>
						<excludePackageNames>${javadoc.excluded.packages}</excludePackageNames>
						<outputDirectory>${basedir}/javadoc</outputDirectory>
						<charset>UTF-8</charset>
					</configuration>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.8</version>
					<extensions>true</extensions>
					<configuration>
						<serverId>ossrh</serverId>
						<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						<autoReleaseAfterClose>true</autoReleaseAfterClose>
					</configuration>
				</plugin>		
			</plugins>
		</pluginManagement>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
			</plugin>
			<!-- Mandatory plugins for using Spock -->
			<plugin>
				<!-- The gmavenplus plugin is used to compile Groovy code. To learn more about this plugin, visit https://github.com/groovy/GMavenPlus/wiki -->
				<groupId>org.codehaus.gmavenplus</groupId>
				<artifactId>gmavenplus-plugin</artifactId>
			</plugin>			
			<!-- Optional plugins for using Spock -->
			<!-- Only required if names of spec classes don't match default Surefire patterns (`*Test` etc.) -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
			</plugin>		
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
			</plugin>
		</plugins>
	</build>
	
	<profiles>
		<profile> 
			<id>release</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
					</plugin>		
				</plugins>
			</build>
		</profile>
		<profile> 
			<id>javadoc</id>
			<properties>
				<tests.skip>true</tests.skip>
			</properties>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>