<?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>demat</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <description>Demat is breton word to said "Hello". Demat is library to run Vega-lite specifications.</description>
    <!-- Properties -->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>YYYY-MM-dd</maven.build.timestamp.format>
        <buildNumber>${maven.build.timestamp}</buildNumber>
        <maven-version>3.5.0</maven-version>
        <java-version>11</java-version>

        <!-- Dependencies versions -->
        <j2html-version>1.5.0</j2html-version>
        <orbisdata-version>2.1.1</orbisdata-version>
        <svgSalamander.version>1.1.4</svgSalamander.version>
        <jackson-core-version>2.17.2</jackson-core-version>
        <junit-version>5.9.1</junit-version>
        <slf4j-version>2.0.16</slf4j-version>
        <groovy-version>4.0.22</groovy-version>
        <javet-version>3.1.8</javet-version>

        <!-- Plugins versions -->
        <exec-maven-version>3.0.0</exec-maven-version>
        <gmaven-version>3.0.2</gmaven-version>
        <maven-assembly-version>3.3.0</maven-assembly-version>
        <maven-bundle-version>5.1.2</maven-bundle-version>
        <maven-clean-version>3.1.0</maven-clean-version>
        <maven-compiler-version>3.8.1</maven-compiler-version>
        <maven-enforcer-version>3.0.0</maven-enforcer-version>
        <maven-gpg-plugin-version>3.0.1</maven-gpg-plugin-version>
        <maven-jar-version>3.2.0</maven-jar-version>
        <maven-javadoc-version>3.3.1</maven-javadoc-version>
        <maven-release-version>3.0.0-M4</maven-release-version>
        <maven-surefire-version>3.0.0-M5</maven-surefire-version>
        <version-maven-version>2.8.1</version-maven-version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.caoccao.javet</groupId>
            <artifactId>javet</artifactId>
            <version>${javet-version}</version>
        </dependency>
        <dependency>
            <groupId>com.formdev</groupId>
            <artifactId>svgSalamander</artifactId>
            <version>${svgSalamander.version}</version>
        </dependency>
        <dependency>
            <groupId>com.j2html</groupId>
            <artifactId>j2html</artifactId>
            <version>${j2html-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson-core-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson-core-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson-core-version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</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.orbisgis.data</groupId>
            <artifactId>data-api</artifactId>
            <version>${orbisdata-version}</version>
        </dependency>
        <dependency>
            <groupId>org.orbisgis.data</groupId>
            <artifactId>h2gis</artifactId>
            <version>${orbisdata-version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Build Settings -->
    <build>
        <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>
                        <includeClasspath>PROJECT_AND_PLUGIN</includeClasspath>
                    </configuration>
                    <executions>
                        <execution>
                            <id>compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>addSources</goal>
                                <goal>addTestSources</goal>
                                <goal>addStubSources</goal>
                                <goal>generateStubs</goal>
                                <goal>compile</goal>
                                <goal>generateTestStubs</goal>
                                <goal>compileTests</goal>
                                <goal>groovydoc</goal>
                                <goal>groovydoc-jar</goal>
                                <goal>removeStubs</goal>
                                <goal>removeTestStubs</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.groovy</groupId>
                            <artifactId>groovy-all</artifactId>
                            <version>4.0.22</version>
                            <type>pom</type>
                        </dependency>
                    </dependencies>
                </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>
                        <fork>true</fork>
                    </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>
                <!-- 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>
                    <executions>
                        <execution>
                            <id>default-jar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>javadoc-jar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <classifier>javadoc</classifier>
                            </configuration>
                        </execution>
                        <execution>
                            <id>sources-jar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                            <configuration>
                                <classifier>sources</classifier>
                            </configuration>
                        </execution>
                    </executions>
                </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>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </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.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <archive>
                        <manifest>
                            <mainClass>org.orbisgis.demat.Plot</mainClass>
                        </manifest>
                    </archive>
                    <finalName>${project.build.finalName}</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <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>
        </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>

    <!-- More Project Information -->
    <name>demat</name>
    <url>https://github.com/ebocher/demat</url>
    <licenses>
        <license>
            <name>GNU Lesser General Public License (LGPLV3+)</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <organization>
        <name>Lab-STICC - CNRS UMR 6285</name>
        <url>https://www.labsticc.fr</url>
    </organization>
    <developers>
        <developer>
            <name>Erwan Bocher</name>
            <id>ebocher</id>
            <url>https://github.com/ebocher</url>
            <organization>Lab-STICC - CNRS UMR 6285</organization>
            <organizationUrl>Lab-STICC - CNRS UMR 6285</organizationUrl>
        </developer>
    </developers>

    <!-- Environment Settings -->
    <issueManagement>
        <system>Github</system>
        <url>https://github.com/orbisgis/orbisgis/issues</url>
    </issueManagement>
    <scm>
        <connection>scm:git:git://github.com/orbisgis/demat</connection>
        <developerConnection>scm:git:https://github.com/orbisgis/demat.git</developerConnection>
        <url>git@github.com:orbisgis/demat.git</url>
        <tag>v1.0.0</tag>
    </scm>
    <repositories>
        <repository>
            <id>orbisgis-release</id>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>orbisgis-snapshot</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>
    <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>
</project>
