<?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>21</version>
    </parent>
    <groupId>org.n52.sensorweb-server.db-model</groupId>
    <artifactId>db-model-parent</artifactId>
    <version>3.0.9</version>
    <name>Sensor Web Server Database Model</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>https://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>https://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>v3.0.9</tag>
    </scm>

    <properties>
        <!-- dev | ci | prod -->
        <env>dev</env>

        <!-- optional properties file -->
        <local.configFile>file:${user.home}/${project.build.finalName}.properties</local.configFile>

        <version.junit>5.7.1</version.junit>
        <hamcrest.version>2.2</hamcrest.version>
        <geotools.version>25.0</geotools.version>
        <geolatte.version>1.8.0</geolatte.version>
        <hibernate.version>5.4.27.Final</hibernate.version>
        <spring-boot.version>2.4.5</spring-boot.version>
        <javax.version>8.0.1</javax.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>db-model-entities</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>db-model-mappings</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>db-model-generator</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>db-model-types</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>db-model-dialects</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>javax</groupId>
                <artifactId>javaee-api</artifactId>
                <version>${javax.version}</version>
            </dependency>

            <dependency>
                <groupId>com.neovisionaries</groupId>
                <artifactId>nv-i18n</artifactId>
                <version>1.28</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.2</version>
            </dependency>

            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.10.10</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.18.1</version>
                <exclusions>
                    <exclusion>
                        <!-- old version dependency causes conclicts -->
                        <groupId>xerces</groupId>
                        <artifactId>xercesImpl</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.geolatte</groupId>
                <artifactId>geolatte-geom</artifactId>
                <version>${geolatte.version}</version>
            </dependency>

            <!-- Testing -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${version.junit}</version>
                <type>pom</type>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</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-surefire-plugin</artifactId>
                    <configuration>
                        <!-- <useSystemClassLoader>false</useSystemClassLoader> -->
                        <!-- see: https://stackoverflow.com/questions/53010200/maven-surefire-could-not-find-forkedbooter-class -->
                        <argLine>-Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
                    </configuration>
                </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>
                </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.15.0</version>
                    <configuration>
                        <configFile>${project.basedir}/etc/eclipse_formatter.xml</configFile>
                        <lineEnding>LF</lineEnding>
                        <sourceDirectory>${project.basedir}</sourceDirectory>
                        <includes>
                            <include>**/src/**/*.java</include>
                        </includes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <configuration>
                        <rules>
                            <requireNoRepositories>
                                <allowedRepositories>
                                    <id>central</id>
                                    <id>geotools</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>
    </profiles>

    <repositories>
        <repository>
            <id>central</id>
            <name>Maven Central</name>
            <url>https://repo.maven.apache.org/maven2</url>
        </repository>
        <repository>
            <id>geotools</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>https://repo.osgeo.org/repository/release/</url>
        </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>

</project>
