<!-- Copyright 2016 vanilladb.org 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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>org.vanilladb</groupId>
	<artifactId>comm</artifactId>
	<version>0.1.0</version>
	<packaging>jar</packaging>

	<name>vanillacomm</name>
	<description>VanillaComm is a collection of reliable group communication primitives (e.g., total-ordering) that can benefit the distributed database systems (e.g., eager-replication, NewSQL database systems).</description>
	<url>http://www.vanilladb.org</url>

	<licenses>
		<license>
			<name>The Apache Software License, Version 2.0</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
		</license>
	</licenses>

	<organization>
		<name>VanillaDB Organization</name>
		<url>http://www.vanilladb.org</url>
	</organization>

	<developers>
		<developer>
			<name>Shan-Hung Wu</name>
			<email>shwu@cs.nthu.edu.tw</email>
		</developer>
		<developer>
			<name>Tsai-Yu Feng</name>
			<email>tyfeng@netdb.cs.nthu.edu.tw</email>
		</developer>
		<developer>
			<name>Meng-Kai Liao</name>
			<email>mkliao@netdb.cs.nthu.edu.tw</email>
		</developer>
		<developer>
			<name>Shao-Kan Pi</name>
			<email>skpi@netdb.cs.nthu.edu.tw</email>
		</developer>
		<developer>
			<name>Yu-Shan Lin</name>
			<email>yslin@netdb.cs.nthu.edu.tw</email>
		</developer>
		<developer>
			<name>Ching Tsai</name>
			<email>ctsai@netdb.cs.nthu.edu.tw</email>
		</developer>
	</developers>

	<scm>
		<connection>scm:git:git://github.com/vanilladb/vanillacomm.git</connection>
		<developerConnection>scm:git:ssh://github.com/vanilladb/vanillacomm.git</developerConnection>
		<url>http://github.com/vanilladb/vanillacomm/tree/master</url>
	</scm>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.9</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>appia</groupId>
			<artifactId>appia</artifactId>
			<version>4.1.2</version>
			<scope>system</scope>
			<systemPath>${basedir}/lib/appia-4.1.2.jar</systemPath>
		</dependency>
	</dependencies>

	<!-- For deploying to the central repository -->
	<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>
			<!-- Use JDK 1.7, instead of the default one (JDK 1.5) -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.5.1</version>
				<configuration>
					<source>1.7</source>
					<target>1.7</target>
				</configuration>
			</plugin>

			<!-- Copy the properties files to a different directory -->
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.0.1</version>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/properties</outputDirectory>
							<resources>
								<resource>
									<directory>src/main/resources</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<!-- Package with dependencies -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
							<!-- <classpathPrefix>lib</classpathPrefix> -->
							<!-- <mainClass>test.org.Cliente</mainClass> -->
						</manifest>
						<manifestEntries>
							<Class-Path>lib/</Class-Path>
						</manifestEntries>
					</archive>
				</configuration>
			</plugin>

			<!-- Generate the source jar -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<!-- Generate JavaDoc -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9.1</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

		</plugins>
	</build>

	<profiles>
		<!-- Make sure release only happening when I need it (To avoid error when 
			others try to run 'mvn install', like Travis CI) -->
		<profile>
			<id>release-sign-artifacts</id>
			<activation>
				<property>
					<name>performRelease</name>
					<value>true</value>
				</property>
			</activation>
			<build>
				<plugins>
					<!-- Sign with GPG keys -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>1.5</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
						<configuration>
							<keyname>vanilladb</keyname>
						</configuration>
					</plugin>

					<!-- Deploy to the central repository -->
					<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>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>
