<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Erlend Hamnaberg
  ~
  ~ 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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>net.hamnaberg.json</groupId>
  <artifactId>immutable-json</artifactId>
  <version>1.0</version>
  <packaging>pom</packaging>
  <name>Immutable JSON</name>
  <description>Immutable JSON</description>
  <url>https://github.com/hamnis/immutable-json</url>
  <inceptionYear>2015</inceptionYear>

  <modules>
    <module>ast</module>
    <module>core</module>
    <module>pointer</module>
    <module>jackson</module>
    <module>javax-json</module>
  </modules>

  <scm>
    <url>https://github.com/hamnis/immutable-json</url>
    <connection>scm:git:https://hamnis@github.com/hamnis/immutable-json.git</connection>
    <developerConnection>scm:git:git@github.com:hamnis/immutable-json.git</developerConnection>
    <tag>v1.0</tag>
  </scm>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/hamnis/immutable-json/issues</url>
  </issueManagement>

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

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>hamnis</id>
      <name>Erlend Hamnaberg</name>
      <email>erlend@hamnaberg.net</email>
      <url>http://twitter.com/hamnis</url>
    </developer>
  </developers>


  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.javaslang</groupId>
        <artifactId>javaslang</artifactId>
        <version>1.2.2</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>json-ast</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>json-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>json-core</artifactId>
        <version>${project.version}</version>
        <classifier>tests</classifier>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>json-pointer</artifactId>
        <version>${project.version}</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

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

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.3</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
            <compilerArgs>
              <arg>-Xlint:unchecked</arg>
              <arg>-Xlint:deprecation</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>2.6</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.2</version>
        <configuration>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <preparationGoals>clean install</preparationGoals>
          <goals>deploy</goals>
          <autoVersionSubmodules>true</autoVersionSubmodules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.4</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sign-gpg</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>1.3.1</version>
            <executions>
              <execution>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <failFast>true</failFast>
                  <fail>true</fail>
                  <rules>
                    <requireProperty>
                      <property>gpg.keyname</property>
                      <message>"You must have a gpg.keyname defined"</message>
                    </requireProperty>
                    <requireProperty>
                      <property>gpg.passphrase</property>
                      <message>"You must have a gpg.passphrase defined"</message>
                    </requireProperty>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <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>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
