<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.jeo</groupId>
  <artifactId>jeo-parent</artifactId>
  <version>0.6</version>
  <packaging>pom</packaging>

  <name>jeo</name>
  <description>
    Java Geospatial Library
  </description>

  <url>http://jeo.io</url>

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

  <developers>
    <developer>
      <name>Justin Deoliveira</name>
      <email>jdeolive@gmail.com</email>
      <organization>jeo</organization>
      <organizationUrl>http://github.com/jeo</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:jeo/jeo.git</connection>
    <developerConnection>scm:git:git@github.com:jeo/jeo.git</developerConnection>
    <url>git@github.com:jeo/jeo.git</url>
  </scm>

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

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>13.0</version>
      </dependency>
      <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
        <version>2.1</version>
      </dependency>
      <dependency>
        <groupId>org.joda</groupId>
        <artifactId>joda-convert</artifactId>
        <version>1.2</version>
      </dependency>
      <dependency>
        <groupId>org.gdal</groupId>
        <artifactId>gdal</artifactId>
        <version>${gdal.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymockclassextension</artifactId>
      <version>2.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.joda</groupId>
      <artifactId>joda-convert</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>${slf4j.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
   <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
   </resources>

   <plugins>
     <!-- set compiler compliance level -->
     <plugin>
       <artifactId>maven-compiler-plugin</artifactId>
       <version>3.1</version>
       <configuration>
         <source>1.7</source>
         <target>1.7</target>
         <debug>true</debug>
         <encoding>UTF-8</encoding>
       </configuration>
     </plugin>

     <!-- attach source jars -->
     <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <configuration>
          <attach>true</attach>
        </configuration>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
     </plugin>

     <!-- attach test jars -->
     <plugin>
       <artifactId>maven-jar-plugin</artifactId>
       <version>2.4</version>
       <executions>
         <execution>
           <phase>package</phase>
           <goals>
             <goal>test-jar</goal>
           </goals>
         </execution>
       </executions>
     </plugin>

     <!-- test configuration -->
     <plugin>
       <artifactId>maven-surefire-plugin</artifactId>
       <version>2.15</version>
       <configuration>
         <argLine>-Djava.library.path=${java.library.path}</argLine> 
       </configuration>
     </plugin>

     <!-- javadoc -->
     <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-javadoc-plugin</artifactId>
      <version>2.9</version>
      <configuration>
        <stylesheetfile>assembly/javadoc.css</stylesheetfile>
        <links>
          <link>http://tsusiatsoftware.net/jts/javadoc</link>
        </links>
        <groups>
          <group>
            <title>Geometries</title>
            <packages>org.jeo.geom*</packages>
          </group>
          <group>
            <title>Projections</title>
            <packages>org.jeo.proj*</packages>
          </group>
          <group>
            <title>Features</title>
            <packages>org.jeo.feature*</packages>
          </group>
          <group>
            <title>Data Access</title>
            <packages>org.jeo.data:org.jeo.filter*</packages>
          </group>
          <group>
            <title>Formats</title>
            <packages>
              org.jeo.data.mem:org.jeo.csv:org.jeo.postgis:org.jeo.mongo:org.jeo.geojson:org.jeo.geogit
             </packages>
          </group>
          <group>
            <title>Styling &amp; Rendering</title>
            <packages>org.jeo.map:org.jeo.carto</packages>
          </group>
          <group>
            <title>Command Line Tools </title>
            <packages>org.jeo.cli*</packages>
          </group>
        </groups>
      </configuration>
    </plugin>

    <!-- test coverage reporting -->
    <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>cobertura-maven-plugin</artifactId>
       <version>2.6</version>
       <configuration>
         <aggregate>true</aggregate>
         <formats>
           <format>html</format>
           <format>xml</format>
         </formats>
       </configuration>
    </plugin>

    <!-- initialize git revision info -->
    <plugin>
      <groupId>pl.project13.maven</groupId>
      <artifactId>git-commit-id-plugin</artifactId>
      <version>2.1.4</version>
      <executions>
        <execution>
          <goals>
            <goal>revision</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <failOnNoGitDirectory>false</failOnNoGitDirectory>
        <dateFormat>yyyy-MM-dd'T'HH:mm:ssZ</dateFormat>
        <skipPoms>false</skipPoms>
        <verbose>false</verbose>
      </configuration>
    </plugin>

    <!-- Check for unsafe API calls -->
    <plugin>
      <groupId>de.thetaphi</groupId>
      <artifactId>forbiddenapis</artifactId>
      <version>1.7</version>
      <executions>
        <execution>
          <goals>
            <goal>check</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <!-- disallow undocumented classes like sun.misc.Unsafe: -->
        <internalRuntimeForbidden>true</internalRuntimeForbidden>
        <bundledSignatures>
          <bundledSignature>jdk-system-out</bundledSignature>
          <bundledSignature>jdk-unsafe</bundledSignature>
          <bundledSignature>jdk-deprecated</bundledSignature>
        </bundledSignatures>
        <failOnUnsupportedJava>false</failOnUnsupportedJava>
        <targetVersion>1.7</targetVersion>
        <excludes>
          <!-- Generated Files -->
          <exclude>io/jeo/json/parser/Yylex.class</exclude>
          <exclude>io/jeo/filter/cql/**</exclude>

          <!-- Uses System.out for printVersionInfo()-->
          <exclude>io/jeo/Jeo.class</exclude>
          <exclude>${forbiddenapis.exclude}</exclude>
        </excludes>
      </configuration>
    </plugin>
   </plugins>
  </build>

  <repositories>
    <repository>
      <id>ossrh</id>
      <name>Sonatype OSS Maven Repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
    <repository>
      <id>boundless</id>
      <name>Boundless Maven Repository</name>
      <url>http://repo.boundlessgeo.com/main</url>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id>assembly</id>
      <build>
        <plugins>
          <!-- attach javadoc jars -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <!-- copy over all dependencies -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>             
                <id>copy-dependencies</id>
                <phase>package</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <artifactItems>
                      <artifactItem>
                        <groupId>${project.groupId}</groupId>
                        <artifactId>${project.artifactId}</artifactId>
                        <version>${project.version}</version>
                        <type>${project.packaging}</type>
                      </artifactItem>
                  </artifactItems>
                  <includeScope>runtime</includeScope>
                </configuration>
              </execution>
            </executions>
          </plugin>

          <!-- sign artifacts -->
          <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>

          <!-- assemble artifacts -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>2.4</version>
            <configuration>
              <finalName>jeo-${project.version}</finalName>
              <descriptors>
                <descriptor>assembly/lib.xml</descriptor>
                <descriptor>assembly/doc.xml</descriptor>
              </descriptors>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <modules>
        <module>assembly</module>
      </modules>
    </profile>
  </profiles>

  <modules>
    <module>core</module>
    <module>format</module>
    <module>util</module>
  </modules>

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

    <!-- config hook to allow modules to specify exclusions -->
    <forbiddenapis.exclude>none</forbiddenapis.exclude>

    <!-- versions -->
    <slf4j.version>1.7.2</slf4j.version>
    <gdal.version>1.11.1</gdal.version>
  </properties>

</project>
