<?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>

    <!-- Maven Coordinates -->
    <groupId>org.orbisgis</groupId>
    <artifactId>orbisparent</artifactId>
    <version>1.0.4</version>
    <packaging>pom</packaging>

    <!-- Project Information -->
    <name>OrbisGIS Parent</name>
    <description>Parent pom for the dependency and plugin management and for the deployment</description>

    <modules>
        <module>commons</module>
        <module>project-archetype</module>
    </modules>

    <organization>
        <name>CNRS</name>
        <url>http://www.orbisgis.org</url>
    </organization>
    <url>http://github.com/orbisgis/orbisgis-parents</url>
    <licenses>
        <license>
            <name>GNU Lesser General Public License (LGPLV3+)</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.html</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Erwan Bocher</name>
            <organization>CNRS, Lab-STICC UMR 6285</organization>
        </developer>
        <developer>
            <name>Sylvain Palominos</name>
            <organization>UBS, Lab-STICC UMR 6285</organization>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/OrbisGIS/orbisparents.git</connection>
        <developerConnection>scm:git:https://github.com/OrbisGIS/orbisparents.git</developerConnection>
        <url>git@github.com:OrbisGIS/orbisparents.git</url>
        <tag>v1.0.4</tag>
    </scm>

    <!-- Properties -->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <maven-version>3.5.0</maven-version>
        <java-version>1.8</java-version>

        <!-- Dependencies versions -->
        <commons-compress-version>1.20</commons-compress-version>
        <commons-io-version>2.7</commons-io-version>
        <groovy-version>3.0.7</groovy-version>
        <h2-version>2.0.201-SNAPSHOT</h2-version>
        <jackson-core-version>2.11.0</jackson-core-version>
        <jts-version>1.18.2</jts-version>
        <junit-version>5.7.0-M1</junit-version>
        <osgi-compendium-version>5.0.0</osgi-compendium-version>
        <osgi-core-version>6.0.0</osgi-core-version>
        <osgi-enterprise-version>5.0.0</osgi-enterprise-version>
        <osgi-service-jdbc-version>1.0.0</osgi-service-jdbc-version>
        <osm-version>1.0.0-SNAPSHOT</osm-version>
        <picocli-version>4.5.2</picocli-version>
        <poly2tri-version>0.1.2</poly2tri-version>
        <postgis-jdbc-version>2.5.0</postgis-jdbc-version>
        <slf4j-version>1.7.30</slf4j-version>
        <smile-version>2.5.3</smile-version>
        <wagon-webdav-jackrabbit-version>3.3.4</wagon-webdav-jackrabbit-version>
        <xstream-version>1.4.11.1</xstream-version>

        <!-- Plugins versions -->
        <exec-maven-version>3.0.0</exec-maven-version>
        <gmaven-version>1.9.0</gmaven-version>
        <jacoco-maven-version>0.8.6</jacoco-maven-version>
        <maven-archetype-plugin-version>3.1.2</maven-archetype-plugin-version>
        <maven-assembly-version>3.3.0</maven-assembly-version>
        <maven-bundle-version>4.2.1</maven-bundle-version>
        <maven-clean-version>3.1.0</maven-clean-version>
        <maven-compiler-version>3.8.1</maven-compiler-version>
        <maven-deploy-version>3.0.0-M1</maven-deploy-version>
        <maven-enforcer-version>3.0.0-M3</maven-enforcer-version>
        <maven-gpg-plugin-version>3.0.1</maven-gpg-plugin-version>
        <maven-install-version>3.0.0-M1</maven-install-version>
        <maven-jar-version>3.2.0</maven-jar-version>
        <maven-javadoc-version>3.2.0</maven-javadoc-version>
        <maven-project-info-reports-version>3.1.0</maven-project-info-reports-version>
        <maven-resources-version>3.1.0</maven-resources-version>
        <maven-site-version>3.9.0</maven-site-version>
        <maven-surefire-report-plugin-version>3.0.0-M4</maven-surefire-report-plugin-version>
        <maven-surefire-version>3.0.0-M4</maven-surefire-version>
        <version-maven>2.7</version-maven>

        <!-- Extensions version -->
        <archetype-packaging-version>3.1.2</archetype-packaging-version>
    </properties>

    <!-- Dependencies -->
    <pluginRepositories>
        <pluginRepository>
            <id>oss-sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>apache-snapshots</id>
            <name>apache-snapshots</name>
            <url>https://repository.apache.org/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons-compress-version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io-version}</version>
            </dependency>
            <dependency>
                <groupId>org.orbisgis</groupId>
                <artifactId>h2</artifactId>
                <version>${h2-version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson-core-version}</version>
            </dependency>
            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>${picocli-version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${groovy-version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-json</artifactId>
                <version>${groovy-version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-sql</artifactId>
                <version>${groovy-version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-templates</artifactId>
                <version>${groovy-version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit-version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit-version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit-version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.locationtech.jts</groupId>
                <artifactId>jts-core</artifactId>
                <version>${jts-version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j-version}</version>
            </dependency>
            <dependency>
                <groupId>net.postgis</groupId>
                <artifactId>postgis-jdbc</artifactId>
                <version>${postgis-jdbc-version}</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>${osgi-compendium-version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>${osgi-core-version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.enterprise</artifactId>
                <version>${osgi-enterprise-version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.jdbc</artifactId>
                <version>${osgi-service-jdbc-version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.haifengl</groupId>
                <artifactId>smile-core</artifactId>
                <version>${smile-version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.github.haifeng</groupId>
                        <artifactId>smile-netlib</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.github.haifengl</groupId>
                <artifactId>smile-data</artifactId>
                <version>${smile-version}</version>
            </dependency>
            <dependency>
                <groupId>com.thoughtworks.xstream</groupId>
                <artifactId>xstream</artifactId>
                <version>${xstream-version}</version>
            </dependency>

            <!-- Test dependencies -->

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j-version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <!-- Build Settings -->
    <build>
        <!-- Extension for Maven archetype -->
        <extensions>
            <extension>
                <groupId>org.apache.maven.archetype</groupId>
                <artifactId>archetype-packaging</artifactId>
                <version>${archetype-packaging-version}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <!-- Clean -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-version}</version>
                </plugin>
                <!-- Groovy -->
                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>${gmaven-version}</version>
                    <configuration>
                        <targetBytecode>${maven.compiler.target}</targetBytecode>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                                <goal>compileTests</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Compilation -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-version}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>
                <!-- Test -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-version}</version>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven-surefire-report-plugin-version}</version>
                </plugin>
                <!-- Generation of the OSGI bundle -->
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>${maven-bundle-version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-Vendor>Lab-STICC - CNRS UMR 6285</Bundle-Vendor>
                        </instructions>
                    </configuration>
                </plugin>
                <!-- Deploy -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-version}</version>
                </plugin>
                <!-- Install -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-version}</version>
                </plugin>
                <!-- Tool version check -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-version}</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <bannedPlugins>
                                        <!-- Will only display a warning but does not fail the build. -->
                                        <level>WARN</level>
                                        <excludes>
                                            <exclude>org.apache.maven.plugins:maven-verifier-plugin</exclude>
                                        </excludes>
                                    </bannedPlugins>
                                    <requireMavenVersion>
                                        <version>${maven-version}</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>${java-version}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Versions check -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${version-maven}</version>
                    <configuration>
                        <rulesUri>
                            https://raw.githubusercontent.com/orbisgis/orbisgis-parents/master/maven-version-rules.xml
                        </rulesUri>
                    </configuration>
                </plugin>
                <!-- Reporting -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-version}</version>
                </plugin>
                <!-- Test coverage -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Javadoc generation -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-version}</version>
                </plugin>
                <!-- Execution -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${exec-maven-version}</version>
                </plugin>
                <!-- Assemble the project with dependencies -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>${maven-assembly-version}</version>
                </plugin>
                <!-- Package the project into a JAR file -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-version}</version>
                </plugin>
                <!-- Maven archetype generation -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-archetype-plugin</artifactId>
                    <version>${maven-archetype-plugin-version}</version>
                </plugin>
                <!-- Maven release generation -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <!-- Sign -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin-version}</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                        </gpgArguments>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Resources -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${maven-resources-version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>display-dependency-updates</goal>
                            <goal>display-plugin-updates</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
                <inherited>false</inherited>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>deploy</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- reporting -->
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-updates-report</report>
                            <report>plugin-updates-report</report>
                            <report>property-updates-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <configuration>
                    <show>public</show>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>
