<?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>
    <parent>
        <groupId>org.n52</groupId>
        <artifactId>parent</artifactId>
        <version>7</version>
    </parent>

    <groupId>org.n52.series-api</groupId>
    <artifactId>series-rest-api</artifactId>
    <version>2.0.0-alpha.5</version>
    <packaging>pom</packaging>
    <name>Series REST API</name>
    <url>http://52north.org/communities/sensorweb/</url>
    <inceptionYear>2013</inceptionYear>

    <modules>
        <module>io</module>
        <module>rest</module>
        <module>spi</module>
    </modules>

    <organization>
        <name>52North Initiative for Geospatial Open Source Software GmbH</name>
        <url>http://52north.org</url>
    </organization>

    <developers>
        <developer>
            <id>bredel</id>
            <name>Henning Bredel</name>
            <email>h.bredel@52north.org</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU General Public License, Version 2.0</name>
            <url>http://www.gnu.de/documents/gpl-2.0.en.html</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/52North/series-rest-api.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/52North/series-rest-api.git</developerConnection>
        <url>https://github.com/52North/series-rest-api</url>
        <tag>v2.0.0-alpha.5</tag>
    </scm>

    <properties>
        <!-- dev | ci | prod -->
        <env>dev</env>
        
        <!-- optional properties file -->
        <local.configFile>file:${user.home}/${project.build.finalName}.properties</local.configFile>
    
        <sensorwebclient.version>3.2.0</sensorwebclient.version>
        <org.springframework.version>4.2.5.RELEASE</org.springframework.version>
        <logback.version>1.2.1</logback.version>
        <jackson.version>2.7.3</jackson.version>
        <geotools.version>14.0</geotools.version>
        <slf4j.version>1.7.24</slf4j.version>
        <hamcrest.version>1.3</hamcrest.version>

        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
        <currentYearDynamic>${maven.build.timestamp}</currentYearDynamic>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <file.encoding>UTF-8</file.encoding>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>io</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>rest</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.sensorweb</groupId>
                <artifactId>xml-pdf-format</artifactId>
                <version>3.2.0</version>
            </dependency>

            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.9.7</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-api</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-main</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <!-- ensure loading before ealier versions -->
                <groupId>org.geotools</groupId>
                <artifactId>gt-opengis</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-epsg-hsql</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-referencing</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-metadata</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geotools</groupId>
                <artifactId>gt-shapefile</artifactId>
                <version>${geotools.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.media</groupId>
                        <artifactId>jai_codec</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.vividsolutions</groupId>
                <artifactId>jts</artifactId>
                <version>1.13</version>
                <exclusions>
                    <exclusion>
                        <!-- old version dependency causes conclicts -->
                        <groupId>xerces</groupId>
                        <artifactId>xercesImpl</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-oxm</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>${org.springframework.version}</version>
            </dependency>

            <dependency>
                <groupId>org.quartz-scheduler</groupId>
                <artifactId>quartz</artifactId>
                <version>2.2.3</version>
            </dependency>

            <dependency>
                <groupId>org.jfree</groupId>
                <artifactId>jfreechart</artifactId>
                <version>1.0.19</version>
            </dependency>
            <dependency>
                <groupId>org.jfree</groupId>
                <artifactId>jcommon</artifactId>
                <version>1.0.24</version>
            </dependency>
            <dependency>
                <groupId>org.apache.xmlgraphics</groupId>
                <artifactId>fop</artifactId>
                <version>2.1</version>
                <exclusions>
                    <exclusion>
                        <!--jcl-over-slf4j is used instead -->
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-io</groupId>
                        <artifactId>commons-io</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>xalan</groupId>
                <artifactId>xalan</artifactId>
                <version>2.7.2</version>
                <exclusions>
                    <exclusion>
                        <!-- uses older xml-apis than other fop dependencies -->
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
                <version>1.3.04</version>
            </dependency>

            <dependency>
                <groupId>org.apache.avalon.framework</groupId>
                <artifactId>avalon-framework-api</artifactId>
                <version>4.3.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.avalon.framework</groupId>
                <artifactId>avalon-framework-impl</artifactId>
                <version>4.3.1</version>
            </dependency>

            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.10</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-math</artifactId>
                <version>2.2</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.5</version>
            </dependency>

            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <!-- drop-in replacement for JCL -->
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <!-- drop-in replacement for jog4j -->
                <groupId>org.slf4j</groupId>
                <artifactId>log4j-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <!-- excludes commons logging -->
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>

        <!-- ==================================================== -->
        <!-- ======== DEBENDENCIES ACTIVE BY DEFAULT ============ -->
        <!-- ==================================================== -->

        <!-- LOGGING DEPENDENCIES -->

    </dependencies>

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

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>install</phase>
                        <goals>
                            <goal>sources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.groovy.maven</groupId>
                <artifactId>gmaven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>execute</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Implementation-Build>${git.commit.id}</Implementation-Build>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <plugin>
                    <!-- license headers -->
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <configuration>
                        <header>etc/license-header.txt</header>
                        <properties>
                            <inceptionYear>${project.inceptionYear}</inceptionYear>
                            <latestYearOfContribution>${currentYear}</latestYearOfContribution>
                            <latestYearOfContribution>${currentYearDynamic}</latestYearOfContribution>
                        </properties>
                        <includes>
                            <include>**/src/**/*.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/logback.xml</exclude>
                            <exclude>**/logback-test.xml</exclude>
                            <exclude>**/src/test/resources/**</exclude>
                            <exclude>**/generated-sources/xml-pdf-format</exclude>
                            <exclude>**/src/main/resources/*</exclude>
                            <exclude>**/src/main/assembly/*</exclude>
                        </excludes>
                        <strictCheck>true</strictCheck>
                    </configuration>
                </plugin>

                <plugin>
                    <!-- dependencies' licenses -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>1.12</version>
                    <configuration>
                        <useMissingFile>true</useMissingFile>
                        <fileTemplate>etc/license-as-csv.ftl</fileTemplate>
                        <licenseMerges>
                            <licenseMerge>The Apache Software License, Version 2.0|Apache 2|Apache License, Version 2.0|Apache License, version 2.0|Apache Public License 2.0|AL 2.0</licenseMerge>
                            <licenseMerge>Apache Software Licenses|Apache Software License|Apache License</licenseMerge>
                            <licenseMerge>GNU General Public License, v2.0|GNU GENERAL PUBLIC LICENSE Version 2, June 1991|GNU General Public License, Version 2.0</licenseMerge>
                            <licenseMerge>Common Development and Distribution License (CDDL), version 1.0| Common Development and Distribution License (CDDL) v1.0</licenseMerge>
                            <licenseMerge>GNU Lesser General Public License, version 2.1|LGPL 2.1</licenseMerge>
                            <licenseMerge>Mozilla Public License version 1.1|MPL 1.1</licenseMerge>
                            <licenseMerge>Eclipse Public License, Version 1.0|Eclipse Public License (EPL), Version 1.0|Eclipse Public License - v 1.0</licenseMerge>
                            <licenseMerge>GNU Lesser General Public Licence|LGPL</licenseMerge>
                        </licenseMerges>
                    </configuration>
                </plugin>

                <plugin>
                    <!-- assemble licenses -->
                    <groupId>org.jasig.maven</groupId>
                    <artifactId>maven-notice-plugin</artifactId>
                    <configuration>
                        <noticeTemplate>etc/NOTICE.template</noticeTemplate>
                        <licenseMapping>
                            <param>etc/license-mappings.xml</param>
                            <param>http://52north.github.io/cdn/licenses/license-mappings.xml</param>
                        </licenseMapping>
                        <generateChildNotices>false</generateChildNotices>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.groovy.maven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <configuration>
                        <source>
                            import java.util.Date
                            import java.text.MessageFormat
                            def vartimestamp = MessageFormat.format("{0,date,yyyy}", new Date())
                            project.properties['currentYearDynamic'] = vartimestamp
                        </source>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>pl.project13.maven</groupId>
                    <artifactId>git-commit-id-plugin</artifactId>
                    <configuration>
                        <dateFormat>yyyy-MM-dd HH:mm:ssZ</dateFormat>
                        <gitDescribe>
                            <skip>true</skip>
                        </gitDescribe>
                        <failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
                        <timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <preparationGoals>clean</preparationGoals>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <descriptors>
                            <descriptor>src/main/assembly/release.xml</descriptor>
                        </descriptors>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <configuration>
                        <rules>
                            <requireNoRepositories>
                                <allowedRepositories>
                                    <id>geotools</id>
                                    <id>n52-releases</id>
                                </allowedRepositories>
                            </requireNoRepositories>
                        </rules>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>2.12</version>
            </extension>
        </extensions>
    </build>

    <profiles>
        <profile>
            <id>env-dev</id>
            <properties>
                <env>dev</env>
                <!-- externalize build parameters for productive environment -->
                <local.configfile>${custom.properties.directory}/${project.build.finalName}-${env}.properties</local.configfile>
            </properties>
            <build>
                <filters>
                    <filter>${local.configfile}</filter>
                </filters>
            </build>
        </profile>

        <profile>
            <id>create-license-list</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-license-list</id>
                                <goals>
                                    <goal>aggregate-add-third-party</goal>
                                </goals>
                                <phase>generate-resources</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>snapshot-dist</id>
            <distributionManagement>
                <repository>
                    <id>n52-releases-dist</id>
                    <name>repository for 52North releases</name>
                    <url>dav:https://52north.org/maven/repo/releases</url>
                </repository>
                <snapshotRepository>
                    <id>n52-snapshots-dist</id>
                    <name>repository for 52North snapshots</name>
                    <url>dav:https://52north.org/maven/repo/snapshots</url>
                </snapshotRepository>
            </distributionManagement>
            
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-enforcer-plugin</artifactId>
                            <configuration>
                                <rules>
                                    <requireNoRepositories>
                                        <allowedRepositories>
                                            <id>geotools</id>
                                            <id>n52-releases</id>
                                            <id>sonatype-nexus-snapshots</id>
                                        </allowedRepositories>
                                    </requireNoRepositories>
                                </rules>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>n52-releases</id>
            <name>52n Releases</name>
            <url>http://52north.org/maven/repo/releases/</url>
        </repository>
        <repository>
            <id>geotools</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>http://download.osgeo.org/webdav/geotools/</url>
            <!--<url>https://boundless.artifactoryonline.com/boundless/main</url> -->
            <!--<url>http://repo.boundlessgeo.com/main/</url> -->
        </repository>
    </repositories>

</project>

