<?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>14</version>
    </parent>
    <groupId>org.n52.series.db</groupId>
    <artifactId>parent</artifactId>
    <version>1.0.0-alpha.8</version>
    <name>Series Database Model - Parent</name>
    <packaging>pom</packaging>

    <modules>
        <module>entities</module>
        <module>mappings</module>
        <module>generator</module>
        <module>types</module>
        <module>dialects</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>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/52North/series-hibernate.git</connection>
        <developerConnection>scm:git:https://github.com/52North/series-hibernate.git</developerConnection>
        <url>https://github.com/52North/series-hibernate</url>
        <tag>v1.0.0-alpha.8</tag>
    </scm>

    <properties>
        <!-- dev | ci | prod -->
        <env>dev</env>

        <!-- optional properties file -->
        <local.configFile>file:${user.home}/${project.build.finalName}.properties</local.configFile>

        <hamcrest.version>1.3</hamcrest.version>
        <geotools.version>21.2</geotools.version>
        <geolatte.version>1.4.0</geolatte.version>
        <hibernate.version>5.4.4.Final</hibernate.version>
        <spring-boot.version>2.1.7.RELEASE</spring-boot.version>
        <arctic-sea.version>7.2.0</arctic-sea.version>

        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>yyyy</maven.build.timestamp.format>
        <currentYearDynamic>${maven.build.timestamp}</currentYearDynamic>
        <file.encoding>UTF-8</file.encoding>

    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>${hibernate.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-spatial</artifactId>
                <version>${hibernate.version}</version>
            </dependency>

            <dependency>
                <!-- Import dependency management from Spring Boot -->
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>

            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>entities</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>mappings</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>generator</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>types</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>dialects</artifactId>
                <version>${project.version}</version>
            </dependency>
            
            
            <dependency>
                <groupId>org.n52.arctic-sea</groupId>
                <artifactId>janmayen</artifactId>
                <version>${arctic-sea.version}</version>
            </dependency>

            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.10.3</version>
            </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>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>
                <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>org.locationtech.jts</groupId>
                <artifactId>jts-core</artifactId>
                <version>1.16.1</version>
            </dependency>
            <dependency>
                <groupId>org.geolatte</groupId>
                <artifactId>geolatte-geom</artifactId>
                <version>${geolatte.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>${hamcrest.version}</version>
            </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.gmaven</groupId>
                <artifactId>groovy-maven-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>

            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <inherited>false</inherited>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</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>
                            <year>${project.inceptionYear}-${currentYearDynamic}</year>
                        </properties>
                        <includes>
                            <include>**/src/**/*.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/logback.xml</exclude>
                            <exclude>**/logback-test.xml</exclude>
                            <exclude>etc/**</exclude>
                        </excludes>
                        <strictCheck>true</strictCheck>
                    </configuration>
                </plugin>

                <plugin>
                    <!-- dependencies' licenses -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <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>
                        </licenseMapping>
                        <generateChildNotices>false</generateChildNotices>
                        <excludeScopes>
                            <excludeScopes>test</excludeScopes>
                            <excludeScopes>provided</excludeScopes>
                        </excludeScopes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>groovy-maven-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>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>2.8.0</version>
                    <configuration>
                        <configFile>${project.basedir}/etc/eclipse_formatter.xml</configFile>
                        <lineEnding>LF</lineEnding>
                        <sourceDirectory>${project.basedir}</sourceDirectory>
                        <includes>
                            <include>**/src/**/*.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/generator/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <configuration>
                        <!-- exclude SQL Generator + Config -->
                        <excludes>org/n52/series/db/generator/**</excludes>
                    </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>

    </build>

    <profiles>

        <profile>
            <id>jdk8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <!-- assemble licenses -->
                            <groupId>org.jasig.maven</groupId>
                            <artifactId>maven-notice-plugin</artifactId>
                            <configuration>
                                <licenseMapping>
                                    <param>http://52north.github.io/cdn/licenses/license-mappings.xml</param>
                                </licenseMapping>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>since-jdk9</id>
            <activation>
                <jdk>[9,)</jdk>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <!-- assemble licenses -->
                            <groupId>org.jasig.maven</groupId>
                            <artifactId>maven-notice-plugin</artifactId>
                            <configuration>
                                <licenseMapping>
                                    <param>http://52north.github.io/cdn/licenses/license-mappings-jdk9.xml</param>
                                </licenseMapping>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </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>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>n52-releases</id>
            <name>52n Releases</name>
            <url>http://52north.org/maven/repo/releases/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </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> -->
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>n52-snapshots</id>
            <name>n52-snapshots</name>
            <url>http://52north.org/maven/repo/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>sonatype-nexus-snapshots</id>
            <name>Sonatype Nexus Snaphots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>
