<?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>fr.ifpen.allotropeconverters</groupId>
    <artifactId>ir2asm</artifactId>
    <version>1.2</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A Java converter from FTIR proprietary data to Allotrope's ASM data</description>
    <url>https://github.com/ifpen/IR2ASM</url>

    <licenses>
        <license>
            <name>CeCILL, version 2.1</name>
            <url>https://opensource.org/license/cecill-2-1/</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Maxime Visconte</name>
            <email>maxime.visconte@ifpen.fr</email>
            <organization>IFPEN</organization>
            <organizationUrl>https://www.ifpenergiesnouvelles.com/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/ifpen/IR2ASM.git</connection>
        <developerConnection>scm:git:ssh://github.com:ifpen/IR2ASM.git</developerConnection>
        <url>https://github.com/ifpen/IR2ASM/tree/main</url>
    </scm>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>2.0.5</version>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>31.1-jre</version>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>com.networknt</groupId>
            <artifactId>json-schema-validator</artifactId>
            <version>1.0.69</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.0</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>2.13.4</version>
        </dependency>
        <dependency>
            <groupId>fr.ifpen.allotropeconverters</groupId>
            <artifactId>ASMUtils</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <version>1.1.2</version>
                <configuration>
                    <sourceDirectory>${basedir}/src/main/resources/</sourceDirectory>
                    <targetPackage>fr.ifpen.allotropeconverters.ir.schema</targetPackage>
                    <refFragmentPathDelimiters>#/</refFragmentPathDelimiters>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.7</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <formats>
                                <format>XML</format>
                            </formats>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <properties>
                <version.maven-release-plugin>3.0.0-M7</version.maven-release-plugin>
                <version.maven-gpg-plugin>3.0.1</version.maven-gpg-plugin>
                <version.nexus-staging-maven-plugin>1.6.13</version.nexus-staging-maven-plugin>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <artifactId>maven-release-plugin</artifactId>
                            <version>${version.maven-release-plugin}</version>
                            <configuration>
                                <tagNameFormat>@{project.version}</tagNameFormat>
                            </configuration>
                        </plugin>
                        <!-- The key's name & passphrase are configured via GitHub's setup-java action. -->
                        <plugin>
                            <artifactId>maven-gpg-plugin</artifactId>
                            <version>${version.maven-gpg-plugin}</version>
                            <executions>
                                <execution>
                                    <id>sign-artifacts</id>
                                    <phase>verify</phase>
                                    <goals>
                                        <goal>sign</goal>
                                    </goals>
                                    <configuration>
                                        <!-- This is required to make sure the plugin does not stop asking for -->
                                        <!-- user input on the passphrase -->
                                        <gpgArguments>
                                            <arg>--pinentry-mode</arg>
                                            <arg>loopback</arg>
                                        </gpgArguments>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>org.sonatype.plugins</groupId>
                            <artifactId>nexus-staging-maven-plugin</artifactId>
                            <version>${version.nexus-staging-maven-plugin}</version>
                            <extensions>true</extensions>
                            <configuration>
                                <serverId>ossrh</serverId>
                                <nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
                                <autoReleaseAfterClose>true</autoReleaseAfterClose>
                            </configuration>
                        </plugin>

                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>