<?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/maven-v4_0_0.xsd">
  
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.brotherlogic</groupId>
  <artifactId>simplestore</artifactId>
  <packaging>jar</packaging>
  <version>0.4</version>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>SimpleStore system java</description>
  <url>https://github.com/BrotherLogic/simplestore</url>

  <properties>
    <checkstyle.version>6.8.1</checkstyle.version>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
  </properties>
  
  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Simon Tucker</name>
      <email>brotherlogic@gmail.com</email>
    </developer>
  </developers>

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

  <scm>
    <connection>scm:git:git@github.com:brotherogic/simplestore.git</connection>
    <developerConnection>scm:git:git@github.com:brotherlogic/simplestore.git</developerConnection>
    <url>git@github.com:brotherlogic/simplestore.git</url>
  </scm>
  
  <prerequisites>
    <maven>3.0.4</maven>
  </prerequisites>
  
  <dependencies>
    <!-- Used for logging -->
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.17</version>
    </dependency>

    <!-- Google for processing json -->
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.3.1</version>
    </dependency>

    <!-- Postgres driver -->
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>9.4-1200-jdbc41</version>
    </dependency>
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-all</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.16</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
    
    <plugins>
      <plugin>
	<groupId>org.jacoco</groupId>
	<artifactId>jacoco-maven-plugin</artifactId>
	<version>0.7.1.201405082137</version>
	<executions>
	  <execution>
	    <id>default-prepare-agent</id>
	    <goals>
	      <goal>prepare-agent</goal>
	    </goals>
	  </execution>
	  <execution>
	    <id>default-report</id>
	    <phase>prepare-package</phase>
	    <goals>
	      <goal>report</goal>
	    </goals>
	  </execution>
	  <execution>
	    <id>default-check</id>
	    <goals>
	      <goal>check</goal>
	    </goals>
	    <configuration>
              <excludes>
                <exclude>**/postgres/*.class</exclude>
              </excludes>
	      <rules>
		<!--  implementation is needed only for Maven 2  -->
		<rule implementation="org.jacoco.maven.RuleConfiguration">
		  <element>BUNDLE</element>
		  <limits>
		    <!--  implementation is needed only for Maven 2  -->
		    <limit implementation="org.jacoco.report.check.Limit">
		      <counter>BRANCH</counter>
		      <value>COVEREDRATIO</value>
		      <minimum>1.0</minimum>
		    </limit>
		  </limits>
		</rule>
	      </rules>
	    </configuration>
	  </execution>
	</executions>
      </plugin>

      <!-- For integration testing -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>2.13</version>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
          </execution>
          <execution>
            <id>verify</id>
            <goals>
              <goal>verify</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>ossrh</serverId>
	  <nexusUrl>https://oss.sonatype.org/</nexusUrl>
	  <autoReleaseAfterClose>true</autoReleaseAfterClose>
	</configuration>
      </plugin>
      <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>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>
      <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.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.16</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <configuration>
              <configLocation>etc/checkstyle.xml</configLocation>
              <encoding>UTF-8</encoding>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
              <failsOnValidation>true</failsOnValidation>
              <linkXRef>false</linkXRef>
            </configuration>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.16</version>
        <configuration>
          <configLocation>etc/checkstyle.xml</configLocation>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  
</project>
