<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015 52°North Initiative for Geospatial Open Source
    Software GmbH

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

    <parent>
        <groupId>org.n52</groupId>
        <artifactId>parent</artifactId>
        <version>2</version>
    </parent>

    <groupId>org.n52.iceland</groupId>
    <artifactId>iceland-parent</artifactId>
    <version>1.2.1</version>

    <packaging>pom</packaging>

    <name>52°North Iceland Aggregator Project</name>
    <description>52°North OWS Framework</description>
    <url>https://github.com/52North/iceland</url>

    <modules>
        <module>core</module>
        <module>statistics/core</module>
        <module>statistics/generator</module>
        <module>statistics/kibana</module>
        <module>statistics/geolocation</module>
    </modules>

    <inceptionYear>2015</inceptionYear>

    <developers>
        <developer>
            <id>CarstenHollmann</id>
            <name>Carsten Hollmann</name>
            <email>c.hollmann@52north.org</email>
            <organization>${project.organization.name}</organization>
            <organizationUrl>${project.organization.url}</organizationUrl>
            <timezone>GMT+1</timezone>
        </developer>
        <developer>
            <id>autermann</id>
            <name>Christian Autermann</name>
            <email>c.autermann@52north.org</email>
            <organization>${project.organization.name}</organization>
            <organizationUrl>${project.organization.url}</organizationUrl>
            <timezone>GMT+1</timezone>
        </developer>
        <developer>
            <id>nuest</id>
            <name>Daniel Nüst</name>
            <email>d.nuest@52north.org</email>
            <organization>${project.organization.name}</organization>
            <organizationUrl>${project.organization.url}</organizationUrl>
            <timezone>GMT+1</timezone>
        </developer>
    </developers>

    <mailingLists>
        <mailingList>
            <name>Sensor Web Community Mailing List</name>
            <subscribe>http://list.52north.org/mailman/listinfo/swe</subscribe>
            <unsubscribe>http://list.52north.org/mailman/listinfo/swe</unsubscribe>
            <post>swe@52north.org</post>
            <archive>http://list.52north.org/pipermail/swe</archive>
            <otherArchives>
                <otherArchive>http://sensorweb.forum.52north.org</otherArchive>
            </otherArchives>
        </mailingList>
    </mailingLists>

    <scm>
        <url>https://github.com/52North/iceland</url>
        <connection>scm:git:https://github.com/52North/iceland.git</connection>
        <developerConnection>scm:git:https://github.com/52North/iceland.git</developerConnection>
      <tag>v1.2.1</tag>
    </scm>

    <issueManagement>
        <system>GitHub issues</system>
        <url>https://github.com/52North/iceland/issues?state=open</url>
    </issueManagement>

    <ciManagement>
        <system>Travis CI</system>
        <url>https://travis-ci.org/52North/iceland</url>
    </ciManagement>

    <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>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <properties>
        <timestamp>${maven.build.timestamp}</timestamp>
        <!-- Source encoding during build process ** !!! DO NOT CHANGE !!! ** -->
        <version.spring>4.2.3.RELEASE</version.spring>
        <version.slf4j>1.7.13</version.slf4j>
        <version.guava>18.0</version.guava>
        <version.java>1.8</version.java>
        <version.jackson>2.6.3</version.jackson>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.n52.iceland</groupId>
                <artifactId>iceland</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.iceland</groupId>
                <artifactId>statistics</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.iceland</groupId>
                <artifactId>statistics-kibana</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.iceland</groupId>
                <artifactId>statistics-generator</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.n52.iceland</groupId>
                <artifactId>iceland-build</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
                <scope>provided</scope>
            </dependency>
            <!-- only needed for the servlet -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>javax.inject</groupId>
                <artifactId>javax.inject</artifactId>
                <version>1</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${version.guava}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.9.1</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${version.jackson}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${version.jackson}</version>
            </dependency>
            <dependency>
                <groupId>stax</groupId>
                <artifactId>stax-api</artifactId>
                <version>1.0.1</version>
            </dependency>

            <!-- Testing dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.10.19</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${version.spring}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>1.10</version>
            </dependency>
            <!-- elasticsearch -->
            <dependency>
                <groupId>org.elasticsearch</groupId>
                <artifactId>elasticsearch</artifactId>
                <version>2.1.0</version>
            </dependency>
            <!-- MaxMind geo database -->
            <dependency>
                <groupId>com.maxmind.geoip2</groupId>
                <artifactId>geoip2</artifactId>
                <version>2.3.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.core</groupId>
                        <artifactId>jackson-databind</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.code.findbugs</groupId>
                       <artifactId>jsr305</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.maxmind.db</groupId>
                <artifactId>maxmind-db</artifactId>
                <version>1.0.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <defaultGoal>install</defaultGoal>

        <plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <preparationGoals>clean install</preparationGoals>
                </configuration>
            </plugin>

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

            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <aggregate>true</aggregate>
                    <header>etc/license-header.txt</header>
                    <excludes>
                        <exclude>**/log4j*</exclude>
                        <exclude>**/pom.xml</exclude>
                        <exclude>**/*.html</exclude>
                        <exclude>**/webapp/static/lib/*</exclude>
                        <exclude>**/webapp/WEB-INF/web.xml</exclude>
                        <exclude>**/buildNumber.properties</exclude>
                    </excludes>
                    <includes>
                        <include>**/*.java</include>
                        <include>**/*.xml</include>
                    </includes>
                    <strictCheck>true</strictCheck>
                    <properties>
                        <!-- TODO for 2016: -->
                        <!--<year>${project.inceptionYear}-${currentYearDynamic}</year>-->
                        <year>${project.inceptionYear}</year>
                    </properties>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <id>format-license-headers</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.jasig.maven</groupId>
                <artifactId>maven-notice-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <noticeTemplate>etc/notice-template.txt</noticeTemplate>
                    <licenseMapping>
                        <param>http://52north.github.io/cdn/licenses/license-mappings.xml</param>
                    </licenseMapping>
                    <generateChildNotices>false</generateChildNotices>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-notice</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerVersion>${version.java}</compilerVersion>
                    <source>${version.java}</source>
                    <target>${version.java}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[${version.java},)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <check>
                        <branchRate>85</branchRate>
                        <lineRate>85</lineRate>
                        <totalBranchRate>85</totalBranchRate>
                        <totalLineRate>85</totalLineRate>
                        <packageLineRate>85</packageLineRate>
                        <packageBranchRate>85</packageBranchRate>
                        <haltOnFailure>false</haltOnFailure>
                    </check>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <failOnError>true</failOnError>
                    <excludeFilterFile>etc/findbugs-excludes.xml</excludeFilterFile>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                    <links>
                        <link>http://docs.guava-libraries.googlecode.com/git-history/v${version.guava}/javadoc/</link>
                        <link>http://www.joda.org/joda-time/apidocs/</link>
                    </links>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>check</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <!-- https://github.com/cobertura/cobertura/issues/248
                            <executions>
                                <execution>
                                    <goals>
                                        <goal>clean</goal>
                                        <goal>check</goal>
                                    </goals>
                                </execution>
                            </executions>
                        -->
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>create-license-list</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>1.5</version>
                        <configuration>
                            <useMissingFile>true</useMissingFile>
                            <fileTemplate>etc/license-as-csv.ftl</fileTemplate>
                        </configuration>
                        <executions>
                            <execution>
                                <id>first</id>
                                <goals>
                                    <goal>aggregate-add-third-party</goal>
                                </goals>
                                <phase>generate-resources</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
