<?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>gc2asm</artifactId>
    <version>2.0</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A Java converter from GC proprietary data to Allotrope's ASM data</description>
    <url>https://github.com/ifpen/GC2ASM</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/GC2ASM.git</connection>
        <developerConnection>scm:git:ssh://github.com:ifpen/GC2ASM.git</developerConnection>
        <url>https://github.com/ifpen/GC2ASM/tree/main</url>
    </scm>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.networknt</groupId>
            <artifactId>json-schema-validator</artifactId>
            <version>1.0.72</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.13.3</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>2.13.4</version>
        </dependency>
        <dependency>
            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>4.0.0</version>
        </dependency>
        <dependency>
            <groupId>fr.ifpen.allotropeconverters</groupId>
            <artifactId>ASMUtils</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <version>1.1.2</version>
                <configuration>
                    <sourcePaths>
                        <sourcePath>src/main/resources/gas-chromatography.tabular.embed.schema.json</sourcePath>
                    </sourcePaths>
                    <targetPackage>fr.ifpen.allotropeconverters.gc.schema</targetPackage>
                    <refFragmentPathDelimiters>#/</refFragmentPathDelimiters>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>xjc</id>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- The package of your generated sources -->
                    <packageName>fr.ifpen.allotropeconverters.gc.chemstation</packageName>
                    <sources>
                        <source>src/main/resources/EXPORT.XSD</source>
                    </sources>
                </configuration>
            </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>