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

<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Copyright © 2019-2023 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>mark-maven-plugin</artifactId>
    <version>${revision}</version>
    <packaging>maven-plugin</packaging>

    <name>Metreeca/Mark</name>
    <description>A minimalist Maven plugin for static site generation</description>
    <url>https://github.com/metreeca/mark</url>
    <inceptionYear>2019</inceptionYear>

    <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>

    <properties>

        <revision>0.9.1</revision>
        <timestamp>${maven.build.timestamp}</timestamp>

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

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.build.timestamp.format>yyyy:MM:dd'T'HH:mm:ss</maven.build.timestamp.format>

        <maven.site.skip>true</maven.site.skip>
        <maven.deploy.skip>true</maven.deploy.skip>

    </properties>

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

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

    <distributionManagement>

        <site>
            <url>https://metreeca.github.io/mark/</url>
        </site>

        <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>
                <groupId>com.metreeca</groupId>
                <artifactId>metreeca-java</artifactId>
                <version>0.0.0-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency> <!-- https://github.com/vsch/flexmark-java -->
                <groupId>com.vladsch.flexmark</groupId>
                <artifactId>flexmark-all</artifactId>
                <version>0.64.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>

        <dependency> <!-- https://maven.apache.org/maven-core/ -->
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>3.8.7</version>
            <scope>provided</scope>
        </dependency>

        <dependency> <!-- https://maven.apache.org/maven-plugin-api/ -->
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>3.8.7</version>
            <scope>provided</scope>
        </dependency>

        <dependency> <!-- https://maven.apache.org/plugin-tools/maven-plugin-annotations/ -->
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
            <version>3.7.1</version>
            <scope>provided</scope>
        </dependency>


        <dependency>
            <groupId>com.metreeca</groupId>
            <artifactId>metreeca-jse</artifactId>
        </dependency>

        <dependency>
            <groupId>com.metreeca</groupId>
            <artifactId>metreeca-json</artifactId>
        </dependency>

        <dependency>
            <groupId>com.metreeca</groupId>
            <artifactId>metreeca-xml</artifactId>
        </dependency>


        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-ext-admonition</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-ext-autolink</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-ext-definition</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-ext-emoji</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-ext-toc</artifactId>
        </dependency>

        <dependency>
            <groupId>com.vladsch.flexmark</groupId>
            <artifactId>flexmark-ext-yaml-front-matter</artifactId>
        </dependency>


        <dependency> <!-- https://github.com/neuland/pug4j -->
            <groupId>de.neuland-bfi</groupId>
            <artifactId>pug4j</artifactId>
            <version>2.0.4</version>
        </dependency>

        <dependency> <!-- https://github.com/i-net-software/jlessc -->
            <groupId>de.inetsoftware</groupId>
            <artifactId>jlessc</artifactId>
            <version>1.10</version>
        </dependency>


        <dependency> <!-- https://search.maven.org/artifact/org.junit.jupiter/junit-jupiter -->
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>5.9.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.24.2</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <repositories>

        <repository>

            <id>central-releases</id>
            <url>https://oss.sonatype.org/content/repositories/releases</url>

            <releases>
                <enabled>true</enabled>
            </releases>

        </repository>

        <repository>

            <id>central-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>

            <snapshots>
                <enabled>true</enabled>
            </snapshots>

        </repository>

    </repositories>

    <build>

        <plugins>

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

                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.1.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/plugin-tools/maven-plugin-plugin/ -->

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

                <executions>

                    <execution>

                        <id>default-descriptor</id>
                        <phase>process-classes</phase>

                        <goals>
                            <goal>descriptor</goal>
                        </goals>

                    </execution>

                    <execution>

                        <id>help-descriptor</id>
                        <phase>process-classes</phase>

                        <goals>
                            <goal>helpmojo</goal>
                        </goals>

                    </execution>

                </executions>

            </plugin>

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

                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>

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

            </plugin>


            <plugin> <!-- https://maven.apache.org/surefire/maven-surefire-plugin/ -->
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M8</version>
            </plugin>

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

                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>

                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>

            </plugin>

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

                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.1</version>

                <executions>
                    <execution>

                        <id>attach-sources</id>

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

                </executions>

            </plugin>

        </plugins>

    </build>

    <profiles>

        <profile>

            <id>release</id>

            <build>
                <plugins>

                    <plugin>

                        <groupId>com.metreeca</groupId>
                        <artifactId>mark-maven-plugin</artifactId>
                        <version>${project.version}</version>

                        <configuration>

                            <readme>true</readme>

                            <options>
                                <markdown-smart-links>true</markdown-smart-links>
                                <markdown-external-links>true</markdown-external-links>
                            </options>

                        </configuration>

                        <executions>
                            <execution>

                                <goals>
                                    <goal>clean</goal>
                                    <goal>build</goal>
                                </goals>

                            </execution>
                        </executions>

                    </plugin>

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

                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>

                        <executions>
                            <execution>

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

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

                                <configuration>
                                    <executable>gpg</executable>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>

                            </execution>
                        </executions>

                    </plugin>

                    <plugin> <!-- https://github.com/sonatype/nexus-maven-plugins -->

                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.8</version>

                        <extensions>true</extensions>

                        <executions>
                            <execution>

                                <id>injected-nexus-deploy</id>
                                <phase>deploy</phase>

                                <goals>
                                    <goal>deploy</goal>
                                </goals>

                                <configuration>
                                    <serverId>ossrh</serverId>
                                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                                </configuration>

                            </execution>
                        </executions>

                        <dependencies>

                            <dependency>  <!-- !!! https://issues.sonatype.org/browse/NEXUS-26993 -->
                                <groupId>com.thoughtworks.xstream</groupId>
                                <artifactId>xstream</artifactId>
                                <version>1.4.15</version>
                                <scope>compile</scope>
                            </dependency>

                        </dependencies>

                    </plugin>

                </plugins>
            </build>
        </profile>

    </profiles>

</project>
