<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2010-2014 GRNET S.A.
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<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>gr.grnet</groupId>
  <artifactId>pithosj</artifactId>
  <version>0.4.2</version>

  <!-- Project details-->
  <name>PithosJ</name>
  <description>
    JVM library for the Pithos+ service of GRNET
  </description>
  <url>https://github.com/grnet/pithos-j</url>
  <inceptionYear>2011</inceptionYear>
  <organization>
    <name>GRNET</name>
    <url>http://www.grnet.gr/</url>
  </organization>

  <developers>
    <developer>
      <id>loverdos</id>
      <name>Christos KK Loverdos</name>
      <email>loverdos@grnet.gr</email>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>GPLv3</name>
      <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/grnet/pithos-j</url>
    <connection>scm:git:https://github.com/grnet/pithos-j.git</connection>
    <developerConnection>scm:git:git://github.com/grnet/pithos-j.git</developerConnection>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/grnet/pithos-j/issues</url>
  </issueManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <!--Common project settings-->
  <properties>
    <scala.main.version>2.11</scala.main.version>
    <scala.version>${scala.main.version}.6</scala.version>
    <scala.xml.version>1.0.3</scala.xml.version>

    <jackson.version>2.5.1</jackson.version>
    <typedkey.version>0.9.0</typedkey.version>

    <snfcommonj.version>0.4.2</snfcommonj.version>

    <finagle.version>6.25.0</finagle.version>
    <twitter.util.version>6.24.0</twitter.util.version>

    <junit.version>4.12</junit.version>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>${project.build.sourceEncoding}</project.reporting.outputEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>${scala.version}</version>
    </dependency>

    <dependency>
      <groupId>org.scala-lang.modules</groupId>
      <artifactId>scala-xml_${scala.main.version}</artifactId>
      <version>${scala.xml.version}</version>
    </dependency>

    <dependency>
      <groupId>gr.grnet</groupId>
      <artifactId>snf-common-j</artifactId>
      <version>${snfcommonj.version}</version>
    </dependency>

    <dependency>
      <groupId>com.ckkloverdos</groupId>
      <artifactId>typedkey</artifactId>
      <version>${typedkey.version}</version>
    </dependency>

    <dependency>
      <groupId>com.twitter</groupId>
      <artifactId>finagle-httpx_${scala.main.version}</artifactId>
      <version>${finagle.version}</version>
    </dependency>

    <dependency>
      <groupId>com.twitter</groupId>
      <artifactId>util-core_${scala.main.version}</artifactId>
      <version>${twitter.util.version}</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.1.1</version>
      <!--<scope>test</scope>-->
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <!-- Bundle up source code on release/snapshot -->
          <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>

          <plugin>
            <groupId>net.alchim31.maven</groupId>
            <artifactId>scala-maven-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
              <recompileMode>incremental</recompileMode>
              <!--<compileOrder>JavaThenScala</compileOrder>-->
              <javacArgs>
                <javacArg>-Xlint:unchecked</javacArg>
                <javacArg>-Xlint:deprecation</javacArg>
              </javacArgs>

              <charset>${project.build.sourceEncoding}</charset>

              <jvmArgs>
                <jvmArg>-Xmx1024m</jvmArg>
              </jvmArgs>

              <args>
                <arg>-deprecation</arg>
                <arg>-unchecked</arg>
                <arg>-explaintypes</arg>
              </args>
            </configuration>
            <executions>
              <execution>
                <id>scala-compile-first</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>add-source</goal>
                  <goal>compile</goal>
                  <goal>doc-jar</goal>
                </goals>
              </execution>

              <execution>
                <id>scala-test-compile</id>
                <phase>process-test-resources</phase>
                <goals>
                  <!--<goal>add-source</goal>-->
                  <goal>testCompile</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- Release plug-in configuration -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
              <preparationGoals>clean verify</preparationGoals>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <configuration>
              <useAgent>true</useAgent>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

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

  <!--Normal build configuration-->
  <build>
    <plugins>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <recompileMode>incremental</recompileMode>
          <!--<compileOrder>JavaThenScala</compileOrder>-->
          <javacArgs>
            <javacArg>-Xlint:unchecked</javacArg>
            <javacArg>-Xlint:deprecation</javacArg>
          </javacArgs>

          <charset>${project.build.sourceEncoding}</charset>

          <jvmArgs>
            <jvmArg>-Xmx1024m</jvmArg>
          </jvmArgs>

          <args>
            <arg>-deprecation</arg>
            <arg>-unchecked</arg>
            <arg>-explaintypes</arg>
          </args>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Make sure tests display failures at the console-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
        <configuration>
          <useFile>false</useFile>
          <reportFormat>plain</reportFormat>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
