<?xml version="1.0" encoding="UTF-8"?>

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Copyright © 2022 Metreeca srl

  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>com.metreeca</groupId>
    <artifactId>metreeca-root</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <name>Metreeca/Root</name>
    <description>Metreeca root Maven POM</description>
    <url>https://github.com/metreeca/root</url>
    <inceptionYear>2022</inceptionYear>

    <properties>

        <revision>1.0.1</revision>

        <java.version>11</java.version>
        <maven.version>3.6</maven.version>

        <node.version>14.15.4</node.version>
        <npm.version>7.7.6</npm.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.build.timestamp.format>yyyyMMdd</maven.build.timestamp.format>

        <timestamp>${maven.build.timestamp}</timestamp> <!-- ;( not directly available to filtered resources -->

    </properties>

    <organization>
        <name>Metreeca</name>
        <url>https://www.metreeca.com/</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Metreeca</name>
            <email>info@metreeca.com</email>
            <organization>Metreeca</organization>
            <organizationUrl>https://www.metreeca.com/</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:metreeca/root.git</connection>
        <developerConnection>scm:git:git@github.com:metreeca/root.git</developerConnection>
        <url>https://github.com/metreeca/root</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/metreeca/root/issues</url>
    </issueManagement>

    <distributionManagement>

        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/releases</url>
        </repository>

        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>

    </distributionManagement>

    <dependencyManagement>

        <dependencies>

            <dependency> <!-- https://search.maven.org/artifact/org.junit.jupiter/junit-jupiter-engine -->
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>5.8.2</version>
                <scope>test</scope>
            </dependency>

            <dependency> <!-- https://search.maven.org/artifact/org.assertj/assertj-core -->
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>3.22.0</version>
                <scope>test</scope>
            </dependency>

        </dependencies>

    </dependencyManagement>

    <build>

        <plugins>

            <plugin> <!-- https://maven.apache.org/enforcer/maven-enforcer-plugin/ -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0</version>

                <executions>
                    <execution>

                        <id>enforce-maven</id>

                        <goals>
                            <goal>enforce</goal>
                        </goals>

                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>${maven.version}</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>

                    </execution>
                </executions>

            </plugin>

            <plugin> <!-- https://maven.apache.org/plugins/maven-compiler-plugin -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.9.0</version>

                <configuration>

                    <source>${java.version}</source>
                    <target>${java.version}</target>

                </configuration>

            </plugin>

            <plugin> <!-- https://maven.apache.org/plugins/maven-jar-plugin/ -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.2</version>

                <configuration>

                    <archive>

                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>

                    </archive>

                </configuration>

            </plugin>

            <plugin> <!-- https://maven.apache.org/plugins/maven-source-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</goal>
                        </goals>

                    </execution>
                </executions>

            </plugin>

            <plugin> <!-- https://maven.apache.org/plugins/maven-javadoc-plugin/ -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.3.1</version>

            </plugin>

            <plugin> <!-- https://maven.apache.org/surefire/maven-surefire-plugin/ -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M5</version>

            </plugin>

            <plugin> <!-- https://maven.apache.org/plugins/maven-site-plugin -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.10.0</version>

                <configuration>
                    <skip>true</skip>
                </configuration>

            </plugin>

            <plugin> <!-- https://maven.apache.org/plugins/maven-deploy-plugin/ -->

                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.0.0-M1</version>

                <configuration>
                    <skip>true</skip>
                </configuration>

            </plugin>

        </plugins>

    </build>

    <profiles>
        <profile>

            <id>release</id>

            <build>
                <plugins>

                    <plugin> <!-- https://maven.apache.org/plugins/maven-javadoc-plugin/ -->

                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>

                        <executions>

                            <execution>

                                <id>attach-javadocs</id>
                                <phase>package</phase>

                                <goals>
                                    <goal>jar</goal>
                                </goals>

                            </execution>

                        </executions>

                    </plugin>

                    <plugin> <!-- http://maven.apache.org/plugins/maven-gpg-plugin/ -->

                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>

                        <configuration>
                            <executable>gpg</executable>
                            <passphraseServerId>gpg.metreeca</passphraseServerId>
                        </configuration>

                        <executions>
                            <execution>

                                <id>sign-artifacts</id>
                                <phase>verify</phase>

                                <goals>
                                    <goal>sign</goal>
                                </goals>

                            </execution>
                        </executions>

                    </plugin>

                    <plugin> <!-- https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-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>true</autoReleaseAfterClose>
                        </configuration>

                        <!-- Remove after OSSRH-66257, NEXUS-26993 are fixed -->
                        <!-- possibly via https://github.com/sonatype/nexus-maven-plugins/pull/91 -->

                        <dependencies>
                            <dependency>
                                <groupId>com.thoughtworks.xstream</groupId>
                                <artifactId>xstream</artifactId>
                                <version>1.4.15</version>
                            </dependency>
                        </dependencies>

                    </plugin>

                </plugins>
            </build>

        </profile>
    </profiles>

</project>
