<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>eu.europa.ec.joinup.sat</groupId>
    <artifactId>demetra-parent</artifactId>
    <version>2.2.2-RC1</version>
    <packaging>pom</packaging>

    <name>JDemetra+</name>
    <description>Seasonal Adjustment Toolkit</description>

    <url>https://github.com/jdemetra/jdemetra-core</url>
    <licenses>
        <license>
            <name>European Union Public Licence (EUPL)</name>
            <url>https://joinup.ec.europa.eu/page/eupl-text-11-12</url>
        </license>
    </licenses>

    <properties>
        <!-- build -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven-compiler-plugin.version>3.8.0</maven-compiler-plugin.version>
        <maven-jar-plugin.version>3.1.0</maven-jar-plugin.version>
        <maven-source-plugin.version>3.0.1</maven-source-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <findbugs-maven-plugin.version>3.0.0</findbugs-maven-plugin.version>
        <animal-sniffer-maven-plugin.version>1.16</animal-sniffer-maven-plugin.version>
        
        <!-- dev support -->
        <junit.version>4.12</junit.version>
        <jsr305.version>3.0.2</jsr305.version>
        <assertj.version>3.11.1</assertj.version>
        <netbeans.version>RELEASE82</netbeans.version>
        <lombok.version>1.18.4</lombok.version>
    </properties>

    <modules>
        <!-- core modules -->
        <module>jtstoolkit</module>
        <module>jtss</module>
        <module>utilities</module>
        <module>demetra-tck</module>
        <module>demetra-workspace</module>

        <!-- I/O modules -->
        <module>odbcprovider</module>
        <module>jdbcprovider</module>
        <module>spreadsheetprovider</module>
        <module>sdmxprovider</module>
        <module>commonprovider</module>

        <!-- several apps -->
        <module>jbench</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- dev tools > -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${jsr305.version}</version>
            </dependency>
            <dependency>
                <groupId>org.netbeans.api</groupId>
                <artifactId>org-openide-util-lookup</artifactId>
                <version>${netbeans.version}</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>
            <!-- < dev tools -->

            <!-- modules > -->
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-tstoolkit</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-tstoolkit2</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-tss</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-utils</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-odbc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-jdbc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-spreadsheet</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-sdmx</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-workspace</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>eu.europa.ec.joinup.sat</groupId>
                <artifactId>demetra-tck</artifactId>
                <version>${project.version}</version>
            </dependency>
            <!-- < modules -->
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>enforce</id>
                            <configuration>
                                <rules>
                                    <DependencyConvergence/>
                                </rules>
                            </configuration>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>${findbugs-maven-plugin.version}</version>
                    <configuration>
                        <findbugsXmlOutput>true</findbugsXmlOutput>
                        <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
                        <xmlOutput>true</xmlOutput>
                        <effort>Max</effort>
                        <threshold>Low</threshold>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
                    <version>${animal-sniffer-maven-plugin.version}</version>
                    <configuration>
                        <signature>
                            <groupId>org.codehaus.mojo.signature</groupId>
                            <artifactId>java18</artifactId>
                            <version>1.0</version>
                        </signature>
                    </configuration>
                    <executions>
                        <execution>
                            <id>check-java18</id>
                            <phase>test</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Add missing Java EE Modules on JDK11 -->
        <profile>
            <activation>
                <jdk>11</jdk>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.activation</groupId>
                    <artifactId>javax.activation-api</artifactId>
                    <version>1.2.0</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>javax.xml.bind</groupId>
                    <artifactId>jaxb-api</artifactId>
                    <version>2.4.0-b180830.0359</version>
                    <scope>provided</scope>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.jaxb</groupId>
                    <artifactId>jaxb-runtime</artifactId>
                    <version>2.4.0-b180830.0438</version>
                    <scope>provided</scope>
                </dependency>                
            </dependencies>
        </profile>

        <!-- Deploy SNAPSHOTS to jfrog with sources -->
        <profile>
            <id>deploy-snapshots</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>oss-jfrog-artifactory</id>
                    <url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
                </snapshotRepository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Deploy RELEASES to jfrog with sources -->
        <profile>
            <id>deploy-releases</id>
            <distributionManagement>
                <repository>
                    <id>oss-jfrog-artifactory</id>
                    <url>https://oss.jfrog.org/artifactory/oss-release-local</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <repositories>
        <repository>
            <id>netbeans-releases</id>
            <url>http://bits.netbeans.org/nexus/content/groups/netbeans/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>oss-jfrog-artifactory-releases</id>
            <url>https://oss.jfrog.org/artifactory/oss-release-local</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>oss-jfrog-artifactory-snapshots</id>
            <url>https://oss.jfrog.org/artifactory/oss-snapshot-local</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>projectlombok.org</id>
            <url>https://projectlombok.org/edge-releases</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>
