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

    <groupId>org.orbisgis</groupId>
    <artifactId>cts</artifactId>
    <version>1.7.2</version>
    <packaging>bundle</packaging>

    <!-- Project Information -->
    <name>cts</name>
    <description>Coordinate Transformation Suite (abridged CTS) is a library developed to perform coordinate
    transformations using well known geodetic algorithms and parameter sets. It strives to be simple, flexible and
    interoperable, in this order.</description>

    <organization>
        <name>CNRS</name>
        <url>http://www.orbisgis.org</url>
    </organization>

    <url>http://github.com/orbisgis/cts</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>Michaël Michaud</name>
            <organization>OpenJUMP Community</organization>
        </developer>
        <developer>
            <name>Erwan Bocher</name>
            <organization>Lab-STICC – CNRS UMR 6285</organization>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/orbisgis/cts.git</connection>
        <developerConnection>scm:git:https://github.com/orbisgis/cts.git</developerConnection>
        <url>git@github.com:orbisgis/cts.git</url>
        <tag>v1.7.2</tag>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/orbisgis/cts/issues</url>
    </issueManagement>

    <!-- Properties -->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-version>3.5.0</maven-version>
        <java-version>11</java-version>
        <maven.compiler.target>${java-version}</maven.compiler.target>
        <maven.compiler.source>${java-version}</maven.compiler.source>

        <!-- Dependencies versions -->
        <junit-version>5.8.2</junit-version>
        <slf4j-version>2.0.16</slf4j-version>

        <!-- Plugins versions -->
        <exec-maven-version>3.0.0</exec-maven-version>
        <maven-assembly-version>3.6.0</maven-assembly-version>
        <maven-bundle-version>5.1.2</maven-bundle-version>
        <maven-enforcer-version>3.4.1</maven-enforcer-version>
        <maven-gpg-plugin-version>3.1.0</maven-gpg-plugin-version>
        <maven-jar-version>3.3.0</maven-jar-version>
        <maven-javadoc-version>3.3.1</maven-javadoc-version>
        <maven-release-version>3.0.1</maven-release-version>
        <maven-surefire-version>3.2.2</maven-surefire-version>
        <version-maven-version>2.16.0</version-maven-version>
    </properties>

    <!-- Dependencies -->
    <repositories>
        <repository>
            <id>repo1.maven.org</id>
            <name>Maven2 repository 1</name>
            <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <name>Central Portal Snapshots</name>
            <id>central-portal-snapshots</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <url>https://repo1.maven.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>
    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit-version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>${slf4j-version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <!-- 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>
                <!-- Test -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-version}</version>
                    <configuration>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                </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>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                            <manifestEntries>
                                <Specification-Vendor-URL>${project.organization.url}</Specification-Vendor-URL>
                                <Specification-URL>${project.url}</Specification-URL>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </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>
                <!-- 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}</version>
                    <configuration>
                        <rulesUri>
                            https://raw.githubusercontent.com/orbisgis/orbisgis-parents/master/maven-version-rules.xml
                        </rulesUri>
                    </configuration>
                </plugin>
                <!-- Javadoc generation -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-version}</version>
                    <configuration>
                        <doclint>all,-missing</doclint>
                        <quiet>true</quiet>
                    </configuration>
                </plugin>
                <!-- Maven release generation -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-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>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.8.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                </configuration>
            </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>
</project>
