<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c)  2020 Dario Lucia (https://www.dariolucia.eu)
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~          http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<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>eu.dariolucia.reatmetric</groupId>
    <artifactId>eu.dariolucia.reatmetric</artifactId>
    <version>1.1.2</version>
    <packaging>pom</packaging>

    <name>REATMETRIC</name>
    <description>Utility and framework for CCSDS/ECSS spacecraft and ground elements monitoring &amp; control.</description>
    <url>https://www.github.com/dariol83/reatmetric</url>

    <developers>
        <developer>
            <name>Dario Lucia</name>
            <email>dario.lucia@gmail.com</email>
            <url>https://www.dariolucia.eu</url>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/dariol83/reatmetric.git</url>
        <connection>scm:git:git@github.com:dariol83/reatmetric.git</connection>
        <developerConnection>scm:git:git@github.com:dariol83/reatmetric.git</developerConnection>
    </scm>

    <properties>
        <!-- Encoding -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!-- Java version -->
        <java.version>11</java.version>
        <!-- External libraries versions -->
        <junit.version>5.10.0-M1</junit.version>
        <openjfx.version>19.0.2.1</openjfx.version>
        <jakarta.version>4.0.0</jakarta.version>
        <jaxb.version>4.0.2</jaxb.version>
        <derby.version>10.15.1.3</derby.version>
        <jdbc.version>19.3.0.0</jdbc.version>
        <graalvm.version>20.2.0</graalvm.version>
        <groovy.version>3.0.9</groovy.version>
        <jython.version>2.7.2</jython.version>
        <ccsds.version>1.0.6</ccsds.version>
        <timeline.version>0.7.0</timeline.version>
        <controlsfx.version>11.0.1</controlsfx.version>
        <usb4java.version>1.3.0</usb4java.version>
        <jserialcomm.version>2.8.0</jserialcomm.version>
        <jsonpath.version>2.7.0</jsonpath.version>
        <snmp4j.version>3.8.2</snmp4j.version>
        <postgresql.version>42.7.3</postgresql.version>
        <!--
        <tiwulf.version>0.1</tiwulf.version>
        -->
        <!-- Maven plugin versions -->
        <maven.jacoco.version>0.8.8</maven.jacoco.version>
        <maven.jar.version>2.4</maven.jar.version>
        <maven.javadoc.version>3.1.0</maven.javadoc.version>
        <maven.source.version>3.1.0</maven.source.version>
        <maven.assembly.version>2.5.5</maven.assembly.version>
        <maven.surefire.version>3.1.2</maven.surefire.version>
        <maven.compiler.version>3.11.0</maven.compiler.version>
        <maven.gpg.version>1.6</maven.gpg.version>
        <maven.version>2.5</maven.version>
        <maven.sonatype.version>0.4.0</maven.sonatype.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <modules>
        <module>eu.dariolucia.reatmetric.api</module>
        <module>eu.dariolucia.reatmetric.processing</module>
        <module>eu.dariolucia.reatmetric.core</module>
        <module>eu.dariolucia.reatmetric.remoting</module>
        <module>eu.dariolucia.reatmetric.remoting.connector</module>
        <module>eu.dariolucia.reatmetric.persist</module>
        <module>eu.dariolucia.reatmetric.persist.timescale</module>
        <module>eu.dariolucia.reatmetric.scheduler</module>
        <module>eu.dariolucia.reatmetric.driver.automation.base</module>
        <module>eu.dariolucia.reatmetric.driver.automation.groovy</module>
        <module>eu.dariolucia.reatmetric.driver.automation.js</module>
        <module>eu.dariolucia.reatmetric.driver.automation.python</module>
        <module>eu.dariolucia.reatmetric.driver.spacecraft</module>
        <module>eu.dariolucia.reatmetric.driver.spacecraft.test</module>
        <module>eu.dariolucia.reatmetric.driver.test</module>
        <module>eu.dariolucia.reatmetric.driver.serial</module>
        <module>eu.dariolucia.reatmetric.driver.remote</module>
        <module>eu.dariolucia.reatmetric.driver.httpserver</module>
        <module>eu.dariolucia.reatmetric.driver.socket</module>
        <module>eu.dariolucia.reatmetric.driver.snmp</module>
        <module>eu.dariolucia.reatmetric.driver.snmp.util</module>
        <module>eu.dariolucia.reatmetric.ui</module>
    </modules>

    <build>
        <plugins>
            <!-- Maven version to use -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${maven.version}</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
            <!-- Set the source file version to Java 11-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.compiler.version}</version>
                <configuration>
                    <release>${java.version}</release>
                </configuration>
            </plugin>
            <!-- Run tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <!-- Activate the use of TCP to transmit events to the plugin -->
                    <forkNode implementation="org.apache.maven.plugin.surefire.extensions.SurefireForkNodeFactory"/>
                </configuration>
            </plugin>
            <!-- Source JAR -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.source.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Javadoc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.javadoc.version}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <show>package</show>
                    <nohelp>true</nohelp>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven.gpg.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${maven.sonatype.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <excludeArtifacts>
                                <artifact>eu.dariolucia.reatmetric.deployment</artifact>
                                <artifact>eu.dariolucia.reatmetric.driver.example</artifact>
                                <artifact>eu.dariolucia.reatmetric.driver.example.test</artifact>
                                <artifact>eu.dariolucia.reatmetric.remoting.test</artifact>
                                <artifact>eu.dariolucia.reatmetric.remoting.ui.remoting</artifact>
                                <artifact>eu.dariolucia.reatmetric.remoting.ui.snmp</artifact>
                                <artifact>eu.dariolucia.reatmetric.remoting.ui.socket</artifact>
                                <artifact>eu.dariolucia.reatmetric.remoting.ui.spacecraft</artifact>
                                <artifact>eu.dariolucia.reatmetric.remoting.ui.test</artifact>
                            </excludeArtifacts>
                            <publishingServerId>central</publishingServerId>
                            <tokenAuth>true</tokenAuth>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>