<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.bsc.maven</groupId>
    <artifactId>maven-confluence-parent</artifactId>
    <packaging>pom</packaging>
    <version>7.4</version>
    <name>CONFLUENCE-REPORTING::Parent</name>
    <description>Maven's plugin that allow to generate "project's documentation" directly to confluence allowing, in the
        same time, to keep in-sync both project &amp; documentation
    </description>
    <url>https://github.com/bsorrentino/maven-confluence-plugin</url>
    <licenses>
        <license>
            <name>Apache License Version 2</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <id>bsorrentino</id>
            <name>Bartolomeo Sorrentino</name>
            <email>bartolomeo.sorrentino@gmail.com</email>
        </developer>
    </developers>
    <modules>
        <module>core</module>
        <module>plugin-reporting</module>
        <module>test-publishing</module>
        <module>test-plugin</module>
        <module>processor-freemarker</module>
        <module>addon-scrollversions</module>
        <module>processor-commonmark</module>
        <module>gitlog+jira</module>
        <module>service-rest-api</module>
        <module>service-xmlrpc-api</module>
        <!--
        <module>test-integration</module>
        <module>processor-pegdown</module>
        -->
    </modules>
    <scm>
        <connection>scm:git:https://github.com/bsorrentino/maven-confluence-plugin.git</connection>
        <developerConnection>scm:git:https://github.com/bsorrentino/maven-confluence-plugin.git</developerConnection>
        <url>https://github.com/bsorrentino/maven-confluence-plugin</url>
        <tag>HEAD</tag>
    </scm>
    <issueManagement>
        <system>github</system>
        <url>https://github.com/bsorrentino/maven-confluence-plugin/issues</url>
    </issueManagement>
    <distributionManagement>
        <repository>
            <id>${release.repo.id}</id>
            <name>central</name>
            <url>${release.repo.url}</url>
        </repository>
        <snapshotRepository>
            <id>${snapshot.repo.id}</id>
            <name>snapshots</name>
            <url>${snapshot.repo.url}</url>
        </snapshotRepository>
        <!--
        <site>
          <id>google-project</id>
          <url>svn:https://bsc-documentation-repo.googlecode.com/svn/trunk/maven-confluence-plugin/</url>
        </site>
        -->
    </distributionManagement>
    <properties>
        <release.repo.id>sonatype-server</release.repo.id>
        <release.repo.url>https://oss.sonatype.org/service/local/staging/deploy/maven2</release.repo.url>
        <snapshot.repo.id>sonatype-server</snapshot.repo.id>
        <snapshot.repo.url>https://oss.sonatype.org/content/repositories/snapshots</snapshot.repo.url>

        <pluginToolsVersion>3.6.0</pluginToolsVersion>
        <addTimestamp>true</addTimestamp>
        <mavenVersion>3.3.1</mavenVersion>
        <!--reports-plugin-version>3.1.1</reports-plugin-version-->
        <reports-plugin-version>2.4</reports-plugin-version>
        <tag>${project.artifactId}-${project.version}</tag>

        <junit.jupiter.version>5.5.2</junit.jupiter.version>
        <junit.platform.version>1.5.2</junit.platform.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <kotlin.version>1.4.21</kotlin.version>
    </properties>

    <repositories>
        <repository>
            <id>${snapshot.repo.id}</id>
            <name>snapshots</name>
            <url>${snapshot.repo.url}</url>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${mavenVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${mavenVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${pluginToolsVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-tools-generators</artifactId>
                <version>${pluginToolsVersion}</version>
                <!--
                SUCH EXCLUSIONS HAVE NEEDED FOR 'ASM' CLASH BETWEEN
                3.3.1 CONTAINED HERE AND 5.0.3 REQUIRED BY PEGDOWN
                <exclusions>
                    <exclusion>
                        <groupId>asm</groupId>
                        <artifactId>asm</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>asm</groupId>
                        <artifactId>asm-tree</artifactId>
                    </exclusion>
                </exclusions>
                -->
            </dependency>
            <dependency>
                <groupId>org.codehaus.plexus</groupId>
                <artifactId>plexus-utils</artifactId>
                <version>3.0.8</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-tools-api</artifactId>
                <version>${pluginToolsVersion}</version>
            </dependency>
            <dependency>
                <groupId>org.bsc.util</groupId>
                <artifactId>minitemplator-repackaged</artifactId>
                <version>1.4</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-testing</groupId>
                <artifactId>maven-plugin-testing-harness</artifactId>
                <version>2.1</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-aether-provider</artifactId>
                <version>${mavenVersion}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.apache.xmlrpc</groupId>
                <artifactId>xmlrpc-client</artifactId>
                <version>3.1.3</version>
            </dependency>

            <dependency>
                <groupId>commons-httpclient</groupId>
                <artifactId>commons-httpclient</artifactId>
                <version>3.1</version>
            </dependency>

            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
                <version>4.7.2</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.7</version>
            </dependency>

            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>1.11</version>
            </dependency>

            <dependency>
                <groupId>org.javalite</groupId>
                <artifactId>javalite-common</artifactId>
                <version>1.4.11</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-stdlib-jdk8</artifactId>
                <version>${kotlin.version}</version>
            </dependency>

            <dependency>
                <groupId>org.kohsuke.metainf-services</groupId>
                <artifactId>metainf-services</artifactId>
                <version>1.8</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.16</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-runner</artifactId>
            <version>${junit.platform.version}</version>
            <scope>test</scope>
        </dependency>

    </dependencies>
    <build>
        <!--
        <extensions>
            <extension>
                <groupId>org.jvnet.wagon-svn</groupId>
                <artifactId>wagon-svn</artifactId>
                <version>1.8</version>
            </extension>
        </extensions>
        -->
        <pluginManagement>
            <plugins>

                <plugin>
                    <!-- Separates the unit tests from the integration tests. -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.2</version>
                    <configuration>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>

                <plugin>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${pluginToolsVersion}</version>
                </plugin>

                <plugin>
                    <groupId>se.bjurr.gitchangelog</groupId>
                    <artifactId>git-changelog-maven-plugin</artifactId>
                    <version>1.84</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>

            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>kotlin-maven-plugin</artifactId>
                <groupId>org.jetbrains.kotlin</groupId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/main/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/main/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>${project.basedir}/src/test/kotlin</sourceDir>
                                <sourceDir>${project.basedir}/src/test/java</sourceDir>
                            </sourceDirs>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                </configuration>
            </plugin>

            <!--
            mvn git-changelog-maven-plugin:git-changelog -N -DtoRef=refs/heads/release/...
            -->
            <plugin>
                <groupId>se.bjurr.gitchangelog</groupId>
                <artifactId>git-changelog-maven-plugin</artifactId>
                <inherited>false</inherited>
                <!-- Minimal config // -->
                <configuration>
                    <settingsFile>changelog.json</settingsFile>
                    <file>CHANGELOG.md</file>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <compilerArgs>
                        <arg>-Xlint:unchecked</arg>
                        <arg>-Xlint:deprecation</arg>
                    </compilerArgs>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                            <version>1.18.16</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <additionalparam>-Xdoclint:none</additionalparam>
                    <outputDirectory>${project.build.directory}/apidocs</outputDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>release</id>
            <build>

                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-no-snapshots</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <phase>verify</phase>
                                <configuration>
                                    <rules>
                                        <requireReleaseDeps>
                                            <message>No Snapshots Allowed!</message>
                                        </requireReleaseDeps>
                                    </rules>
                                    <fail>true</fail>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!--
                    ====================================================================================
                    # https://github.com/keybase/keybase-issues/issues/2798
                    export GPG_TTY=$(tty)
                    mvn -Prelease source:jar javadoc:jar deploy -Dgpg.passphrase=thephrase
                    ====================================================================================
                    -->
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.5.1</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>sonatype-server</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <stagingProfileId/>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
