<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>io.whitfin</groupId>
    <artifactId>dot-notes</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>Dot Notes</name>
    <description>
        A simple Jackson flattening/inflation tool, for use with JSON objects.
    </description>
    <url>https://github.com/whitfin/dot-notes-java</url>

    <properties>
        <cobertura.version>2.7</cobertura.version>
        <jackson2.version>2.5.2</jackson2.version>
        <jacoco.version>0.7.5.201505241946</jacoco.version>
    </properties>

    <developers>
        <developer>
            <id>whitfin</id>
            <name>Isaac Whitfield</name>
            <email>isaac@whitfin.io</email>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:whitfin/dot-notes-java.git</connection>
        <developerConnection>scm:git:git@github.com:whitfin/dot-notes-java.git</developerConnection>
        <url>git@github.com:whitfin/dot-notes-java.git</url>
    </scm>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

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

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson2.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson2.version}</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8.7</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>cobertura</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>coverage.report</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- Declare what should be instrumented for cobertura -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <version>${cobertura.version}</version>
                        <executions>
                            <execution>
                                <id>clean</id>
                                <phase>clean</phase>
                                <goals>
                                    <goal>clean</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>cobertura</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>cobertura</goal>
                                </goals>
                                <configuration>
                                    <aggregate>true</aggregate>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jacoco</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>jacoco.report</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
               <plugins>
                   <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>
                       <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>ossrh</serverId>
                           <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                           <autoReleaseAfterClose>false</autoReleaseAfterClose>
                       </configuration>
                   </plugin>
               </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
