<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.insee.trevas</groupId>
    <artifactId>trevas-parent</artifactId>
    <packaging>pom</packaging>
    <version>0.2.0</version>
    <modules>
        <module>vtl-parser</module>
        <module>vtl-model</module>
        <module>vtl-engine</module>
        <module>vtl-jackson</module>
        <module>vtl-spark</module>
    </modules>

    <name>Trevas</name>
    <description>Transformation engine and validator for statistics.</description>
    <url>https://inseefr.github.io/Trevas</url>
    <organization>
        <name>Insee</name>
        <url>http://insee.fr</url>
    </organization>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:https://github.com/InseeFr/Trevas.git</connection>
        <developerConnection>scm:git:https://github.com/InseeFr/Trevas.git</developerConnection>
        <url>https://github.com/InseeFr/Trevas/tree/${project.scm.tag}</url>
        <tag>master</tag>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/InseeFr/Trevas/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Travis</system>
        <url>https://travis-ci.org/InseeFr/Trevas</url>
    </ciManagement>

    <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>
        <site>
            <!-- Both id and url are required for site:stage; placeholder URL for now. -->
            <id>trevas-site</id>
            <url>scp://localhost/trevas/</url>
        </site>
    </distributionManagement>

    <properties>
        <jdk.version>11</jdk.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jacoco.version>0.8.5</jacoco.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.21.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <!-- Restore the default maven final artifact name. -->
        <finalName>${project.artifactId}-${project.version}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M4</version>
                <configuration>
                    <!-- Sets the VM argument line used when unit tests are run. -->
                    <!-- Suppress UnresolvedMavenProperty. -->
                    <argLine>-Xms1g -Xmx2g -XX:MaxPermSize=256m @{surefireArgLine}</argLine>
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <forkedProcessExitTimeoutInSeconds>180</forkedProcessExitTimeoutInSeconds>
                    <forkCount>1</forkCount>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <!-- Prepare the property pointing to the JaCoCo runtime agent which is
                         passed as VM argument when the Maven Surefire plugin is executed. -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Set the name of the property containing the settings for JaCoCo
                                 runtime agent. -->
                            <propertyName>surefireArgLine</propertyName>
                            <append>true</append>
                        </configuration>
                    </execution>
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.7.0.1746</version>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <release>${jdk.version}</release>
                        <testRelease>${jdk.version}</testRelease>
                        <target>${jdk.version}</target>
                        <source>${jdk.version}</source>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.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-site-plugin</artifactId>
                        <version>3.9.1</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>3.1.1</version>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.2.0</version>
						<configuration>
                            <source>8</source>
							<detectJavaApiLink>false</detectJavaApiLink>
							<doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>aggregate</id>
                                <goals>
                                    <goal>aggregate</goal>
                                </goals>
                                <phase>site</phase>
                            </execution>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <configuration>
                                    <keyname>05F6A3AA6CA98FFB</keyname>
                                </configuration>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <developers>
        <developer>
            <name>Hadrien Kohl</name>
        </developer>
        <developer>
            <name>Nicolas Laval</name>
        </developer>
        <developer>
            <name>Franck Cotton</name>
        </developer>
    </developers>

</project>