<?xml version="1.0" encoding="UTF-8"?>
<project
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<modelVersion>4.0.0</modelVersion>

	<groupId>cc.kave.repackaged</groupId>
	<artifactId>cc.kave.repackaged.jayes</artifactId>
	<version>0.0.2</version>

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

	<name>${project.groupId}:jayes</name>
	<description>Repackaging of Jayes (Eclipse Code Recommenders) to make it available in Maven.</description>
	<url>http://www.eclipse.org/recommenders/jayes/</url>

	<licenses>
		<license>
			<name>Eclipse Public License v1.0</name>
			<url>http://www.eclipse.org/legal/epl-v10.html</url>
		</license>
	</licenses>
	
	<developers>
		<developer>
			<name>Michael Kutschke</name>
			<organization>Eclipse Code Recommenders</organization>
			<organizationUrl>http://www.eclipse.org/recommenders/jayes/</organizationUrl>
			<roles>
				<role>developer</role>
			</roles>
		</developer>
		<developer>
			<name>Sebastian Proksch</name>
			<email>development@mail.proks.ch</email>
			<organization>KaVE Project</organization>
			<organizationUrl>http://kave.cc/</organizationUrl>
			<roles>
				<role>repackaging</role>
			</roles>
		</developer>
	</developers>
	
	<scm>
		<connection>scm:git:https://github.com/kutschkem/Jayes.git</connection>
		<developerConnection>scm:git:https://github.com/kutschkem/Jayes.git</developerConnection>
		<url>https://github.com/kutschkem/Jayes</url>
	</scm>


	<!-- The following block contains general stuff that is only relevant for the deployment. -->


	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>3.6.1</version>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>

		<plugins>
			
			<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</goal></goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.10.4</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals><goal>jar</goal></goals>
					</execution>
				</executions>
			</plugin>

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

	<!--
		We use two profiles for the build that differ in the deployment:
		* "testing" (default): for local deployment
		* "production": for deployment in the ossrh repository
	-->
	<profiles>
		<!-- deployment into a local folder, existence of a specific property in settings.xml will be checked -->
		<profile>
			<id>testing</id>
			<activation><activeByDefault>true</activeByDefault></activation>

			<distributionManagement>
				<snapshotRepository>
					<id>repo_testing_snapshots</id>
					<url>file://${repository.local.cc.kave}/snapshots</url>
				</snapshotRepository>
				<repository>
					<id>repo_testing_releases</id>
					<url>file://${repository.local.cc.kave}/releases</url>
				</repository>
			</distributionManagement>

			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-enforcer-plugin</artifactId>
						<version>1.4.1</version>
						<executions>
							<execution>
								<id>enforce-property</id>
								<goals><goal>enforce</goal></goals>
								<configuration>
									<rules>
										<requireProperty>
											<property>repository.local.cc.kave</property>
											<message>Add the property "repository.local.cc.kave" to your "~/.m2/settings.xml" and specify a folder for local deployment.</message>
										</requireProperty>
									</rules>
									<fail>true</fail>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<!-- deployment into the ossrh repository using the official nexus pluign -->
		<profile>
			<id>production</id>

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

			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.7</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>false</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
