<?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>
    <parent>
        <groupId>org.n52</groupId>
        <artifactId>parent</artifactId>
        <version>7</version>
    </parent>
    <groupId>org.n52.series-api.db</groupId>
    <artifactId>series-dao</artifactId>
    <version>2.0.0-alpha.2</version>
    <name>Series DAO REST API</name>
    <packaging>pom</packaging>

    <modules>
        <module>dao</module>
        <module>sos-integration</module>
        <module>mappings</module>
        <module>webapp</module>
    </modules>

    <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/dao-series-api.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/52North/dao-series-api.git</developerConnection>
        <url>https://github.com/52North/dao-series-api</url>
        <tag>v2.0.0-alpha.2</tag>
    </scm>
    
    <properties>
        <!-- dev | ci | prod -->
        <env>dev</env>
        
        <!-- optional properties file -->
        <local.configFile>file:${user.home}/${project.build.finalName}.properties</local.configFile>
    
        <org.springframework.version>4.2.5.RELEASE</org.springframework.version>
        <logback.version>1.1.3</logback.version>
        <jackson.version>2.7.3</jackson.version>
        <geotools.version>14.0</geotools.version>
        <slf4j.version>1.7.12</slf4j.version>
        <hamcrest.version>1.3</hamcrest.version>
        <hibernate.version>4.3.11.Final</hibernate.version>
        <series.api.version>2.0.0-alpha.5</series.api.version>

        <java.compiler.source>1.8</java.compiler.source>
        <java.compiler.target>1.8</java.compiler.target>
        <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>dao</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sos-integration</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>mappings</artifactId>
                <version>${project.version}</version>
            </dependency>
            
            <dependency>
                <groupId>org.n52.series-api</groupId>
                <artifactId>spi</artifactId>
                <version>${series.api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.series-api</groupId>
                <artifactId>io</artifactId>
                <version>${series.api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.series-api</groupId>
                <artifactId>rest</artifactId>
                <version>${series.api.version}</version>
            </dependency>
            
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.8.2</version>
            </dependency>
            <dependency>
                <groupId>org.quartz-scheduler</groupId>
                <artifactId>quartz</artifactId>
                <version>2.1.7</version>
            </dependency>
            
            <dependency>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
                <version>1.3.04</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.jfree</groupId>
                <artifactId>jfreechart</artifactId>
                <version>1.0.19</version>
            </dependency>
            <dependency>
                <groupId>org.jfree</groupId>
                <artifactId>jcommon</artifactId>
                <version>1.0.23</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.0</version>
                <exclusions>
                    <exclusion>
                        <!-- uses older xml-apis than other fop dependencies -->
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                    </exclusion>
                </exclusions>
            </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-orm</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>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.0.1</version>
                <scope>provided</scope>
            </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-classic</artifactId>
                <version>${logback.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</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>

    <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>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>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Implementation-Build>${git.commit.id}</Implementation-Build>
                        </manifestEntries>
                    </archive>
                </configuration>
                <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>
                    <version>3.0.2</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>2.10</version>
                </plugin>

                <plugin>
                    <!-- license headers -->
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.11</version>
                    <configuration>
                        <header>misc/52N_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.8</version>
                    <configuration>
                        <useMissingFile>true</useMissingFile>
                        <fileTemplate>misc/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>
                    <version>1.0.6.1</version>
                    <configuration>
                        <noticeTemplate>misc/NOTICE.template</noticeTemplate>
                        <licenseMapping>
                            <param>misc/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>
                    <version>1.0</version>
                    <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>
                    <version>2.2.1</version>
                    <configuration>
                        <dateFormat>yyyy-MM-dd HH:mm:ssZ</dateFormat>
                        <gitDescribe>
                            <!-- Faster to get just branch if skip = true -->
                            <skip>false</skip>
                        </gitDescribe>
                        <failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
                        <timestampFormat>{0,date,yyyy-MM-dd HH:mm:ss}</timestampFormat>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>${java.compiler.source}</source>
                        <target>${java.compiler.target}</target>
                        <meminitial>256m</meminitial>
                        <maxmem>512m</maxmem>
                    </configuration>
                </plugin>

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

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.6</version>
                    <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>
                                    <id>n52-snapshots</id>
                                    <id>sonatype-nexus-snapshots</id>
                                </allowedRepositories>
                            </requireNoRepositories>
                        </rules>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-webdav-jackrabbit</artifactId>
                <version>2.10</version>
            </extension>
        </extensions>
        
    </build>
    
    <profiles>
        <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>
        </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>
        </repository>
        <repository>
            <id>n52-snapshots</id>
            <name>n52-snapshots</name>
            <url>http://52north.org/maven/repo/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>
