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

<!--
  ~ Copyright (c) jGuru Europe AB.
  ~ All rights reserved.
  -->

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

    <!--
    ################################################
    # Section 1:  Project information
    ################################################
    -->
    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
        <relativePath />
    </parent>

    <groupId>se.jguru.codestyle.annotations</groupId>
    <artifactId>jguru-codestyle-annotations</artifactId>
    <version>0.9.7</version>
    <name>${project.artifactId}</name>
    <packaging>jar</packaging>
    <url>${site.top.url}/${path.in.reactor}</url>
    <description>jGuru Codestyle: Annotations (JAR, version ${project.version})</description>
    <inceptionYear>2018</inceptionYear>

    <organization>
        <name>jGuru Europe AB</name>
        <url>http://www.jguru.se/</url>
    </organization>

    <licenses>
        <license>
            <name>jGuru Europe Corporate Source License, based on The Apache Software License, Version 2.0</name>
            <url>http://www.jguru.se/licenses/jguruCorporateSourceLicense-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>A business-friendly OSS license</comments>
        </license>
    </licenses>

    <properties>
        <!--
            Define the URL prefixes for Site Deployment and DistributionManagement.
            These can be overridden in sub-reactors to tailor releases to other locations.
        -->
        <reactor.name>jguru-codestyle</reactor.name>
        <path.in.reactor>annotations</path.in.reactor>

        <!-- Kotlin constants -->
        <kotlin.version>1.3.31</kotlin.version>
        <kotlin.jvm.target>1.8</kotlin.jvm.target>
        <kotlin.plugin>jpa</kotlin.plugin>

        <!--
            Define URL prefixes used in the various URL settings of the POM.
        -->
        <github.global.server>nazgul_github</github.global.server>
        <git.repo.owner>lennartj</git.repo.owner>
        <git.repo.url.prefix>https://github.com/${git.repo.owner}</git.repo.url.prefix>
        <git.scm.url.prefix>scm:git:ssh://git@github.com/${git.repo.owner}</git.scm.url.prefix>
        <site.url.prefix>http://${git.repo.owner}.github.io</site.url.prefix>
        <site.top.url>${site.url.prefix}/${reactor.name}/Documentation/${project.version}</site.top.url>

        <scm.connection.url>scm:git:${git.repo.url.prefix}/${reactor.name}.git</scm.connection.url>
        <scm.devConnection.url>${git.scm.url.prefix}/${reactor.name}.git</scm.devConnection.url>
        <distroManagement.url>${site.top.url}/${path.in.reactor}</distroManagement.url>
        <scm.url>${git.repo.url.prefix}/${reactor.name}.git</scm.url>
        <site.staging.localDirectory>/tmp/${reactor.name}</site.staging.localDirectory>

        <maven.version>3.0</maven.version>
        <jdk.version>1.8</jdk.version>

        <!-- Code style properties -->
        <pmd.plugin.version>3.11.0</pmd.plugin.version>
        <clover.plugin.version>4.2.1</clover.plugin.version>
        <spotbugs.plugin.version>3.1.11</spotbugs.plugin.version>
        <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
        <checkstyle.header.java.file>codestyle/copyright/header_java.txt</checkstyle.header.java.file>
        <clean.plugin.version>2.6.1</clean.plugin.version>

        <!-- Site plugin properties -->
        <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
        <doxia-modules.version>1.8</doxia-modules.version>
        <wagon-modules.version>2.10</wagon-modules.version>
        <versions-maven-plugin.version>2.7</versions-maven-plugin.version>
        <scm.provider.version>1.11.2</scm.provider.version>
    </properties>

    <repositories>
        <repository>
            <id>jcenter</id>
            <url>http://jcenter.bintray.com</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
                <checksumPolicy>warn</checksumPolicy>
            </releases>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <name>jcenter</name>
            <url>http://jcenter.bintray.com</url>
        </pluginRepository>
    </pluginRepositories>

    <developers>
        <developer>
            <id>lj</id>
            <name>Lennart Jörelid</name>
            <email>lj@jguru.se</email>
            <roles>
                <role>Committer</role>
            </roles>
            <organization>jGuru Europe AB</organization>
            <organizationUrl>http://www.jguru.se</organizationUrl>
            <timezone>+1</timezone>
        </developer>
    </developers>

    <!--
    ################################################
    # Section 2:  Dependency (management) settings
    ################################################
    -->

    <!--
    ################################################
    # Section 3:  Build settings
    ################################################
    -->
    <build>

        <pluginManagement>
            <plugins>

                <!--
                    Up the version of the source plugin.

                    Why:  Use a newer source plugin version.
                    Used: Only when called, typically release profile.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>

                <!--
                    Configure the javadoc plugin not to fail on standard HTML
                    constructs when building using JDK 8.
                    Typical standard constructs include empty tags, like: <p />
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.0.1</version>
                    <configuration>
                        <failOnError>false</failOnError>
                        <stylesheet>java</stylesheet>
                        <groups>
                            <group>
                                <title>jGuru Codestyle</title>
                                <packages>se.jguru.codestyle.*</packages>
                            </group>
                            <group>
                                <title>Nazgul Framework: Tools Packages</title>
                                <packages>se.jguru.nazgul.tools.*</packages>
                            </group>
                            <group>
                                <title>Nazgul Framework: Core Packages</title>
                                <packages>se.jguru.nazgul.core.*</packages>
                            </group>
                            <group>
                                <title>Nazgul Framework: Test Artifact Packages</title>
                                <packages>se.jguru.nazgul.test.*</packages>
                            </group>
                        </groups>
                        <useStandardDocletOptions>true</useStandardDocletOptions>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <docencoding>${project.build.sourceEncoding}</docencoding>
                        <charset>${project.build.sourceEncoding}</charset>
                        <breakiterator>true</breakiterator>
                        <version>true</version>
                        <author>true</author>
                        <keywords>true</keywords>
                    </configuration>
                </plugin>

                <!--
                    Use a working version of the Maven versions plugin.
                    (TODO: Update the Codehaus versions plugin with the fine additions done by Lars.)

                    Why:  Workaround for https://jira.codehaus.org/browse/MVERSIONS-236
                    Used: Only when called.
                -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${versions-maven-plugin.version}</version>
                </plugin>

                <!--
                    Upgrade the Compiler plugin to the latest version.

                    Why:  Use the latest compiler plugin version for upwards JDK compliance.
                    Used: For compiling all source code to binaries.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                        <showWarnings>true</showWarnings>
                        <showDeprecation>true</showDeprecation>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>

                <!--
                    Configures the release plugin to use a custom release profile.

                    Why:  Release artifacts
                    Used: Normal lifecycle, release goal
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration combine.self="override">
                        <arguments>-Pjguru-release</arguments>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <useReleaseProfile>false</useReleaseProfile>
                        <tagNameFormat>${reactor.name}-@{project.version}</tagNameFormat>
                        <goals>deploy</goals>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>${scm.provider.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-api</artifactId>
                            <version>${scm.provider.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <!--
                    Specify the version of the GPG plugin

                    Why:  Used to sign artifacts.
                    Used: To sign artifacts, using GPG.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <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>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!--
                Configures the site plugin. Its use is further documented in the site documentation itself.

                Why:  Make compile and publish the Codestyle documentation.
                Used: Site lifecycle, mvn site.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>${maven-site-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-descriptor</id>
                        <goals>
                            <goal>attach-descriptor</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>default-deploy</id>
                        <phase>site-deploy</phase>
                        <goals>
                            <goal />
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <topSiteURL>${site.url.prefix}/${reactor.name}</topSiteURL>
                    <stagingSiteURL>${site.url.prefix}/${reactor.name}</stagingSiteURL>
                    <stagingDirectory>${site.staging.localDirectory}</stagingDirectory>
                    <generateSitemap>true</generateSitemap>
                    <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
                    <outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
                </configuration>
            </plugin>

            <!--

                Configures the release plugin to use a custom release profile.

                Why:  Release artifacts
                Used: Normal lifecycle, release goal
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>

            <!--
                Define OSGi bundle plugin version.

                Why:  Plugin used to generate OSGi Manifest headers in JARs.
                Used: As included in [sub]projects.
            -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>4.2.0</version>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <supportedProjectTypes>
                        <supportedProjectType>ejb</supportedProjectType>
                        <supportedProjectType>jar</supportedProjectType>
                        <supportedProjectType>bundle</supportedProjectType>
                        <supportedProjectType>war</supportedProjectType>
                        <supportedProjectType>ear</supportedProjectType>
                    </supportedProjectTypes>
                    <instructions>
                        <_consumer-policy><![CDATA[$<range;[===,+)>]]></_consumer-policy>
                        <_provider-policy><![CDATA[$<range;[===,=+)>]]></_provider-policy>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Embed-Directory>lib</Embed-Directory>
                        <Export-Package>{local-packages}</Export-Package>
                    </instructions>
                </configuration>
            </plugin>

            <!--
                Enforce not importing incorrect projects.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>enforce-imports</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[3.0.4,)</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>${jdk.version}</version>
                                </requireJavaVersion>&gt;
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <outputDirectory>${project.build.directory}/site</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <configuration>
                    <failOnError>false</failOnError>
                    <stylesheet>java</stylesheet>
                    <groups>
                        <group>
                            <title>jGuru Codestyle</title>
                            <packages>se.jguru.codestyle.*</packages>
                        </group>
                        <group>
                            <title>Nazgul Framework: Tools Packages</title>
                            <packages>se.jguru.nazgul.tools.*</packages>
                        </group>
                        <group>
                            <title>Nazgul Framework: Core Packages</title>
                            <packages>se.jguru.nazgul.core.*</packages>
                        </group>
                    </groups>
                    <useStandardDocletOptions>true</useStandardDocletOptions>
                    <charset>${project.build.sourceEncoding}</charset>
                    <breakiterator>true</breakiterator>
                    <version>true</version>
                    <author>true</author>
                    <keywords>true</keywords>
                </configuration>
            </plugin>

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

            <!--

                Use a working version of the Maven versions plugin.

                Why:  Workaround for https://jira.codehaus.org/browse/MVERSIONS-236
                Used: Only when called.
            -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${versions-maven-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <!--
    ################################################
    # Section 4:  External systems
    ################################################
    -->

    <!--
        Define the Continuous Build server address.
    -->
    <ciManagement>
        <system>TravisCI</system>
        <url>https://travis-ci.org/lennartj/jguru-codestyle</url>
    </ciManagement>

    <!--
        Define the issue management system.
    -->
    <issueManagement>
        <system>github</system>
        <url>https://github.com/lennartj/jguru-codestyle/issues</url>
    </issueManagement>

    <!--
        Define repository settings for Maven's deploy and release plugins.
        Move parts to settings.xml, as per recommendation within Maven specs.
    -->
    <distributionManagement>
        <repository>
            <id>ossrh-staging</id>
            <name>Sonatype OSS Nexus: Releases</name>
            <url>http://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>ossrh-snapshots</id>
            <name>Sonatype OSS Nexus: Snapshots</name>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <site>
            <id>github_site</id>
            <name>GitHub Site for jGuru Codestyle</name>
            <url>${site.top.url}/${path.in.reactor}</url>
        </site>
    </distributionManagement>

    <!--
        Define connections for Maven's VCS integration.
    -->
    <scm>
        <connection>${scm.connection.url}</connection>
        <developerConnection>${scm.devConnection.url}</developerConnection>
        <url>${scm.url}</url>
        <tag>jguru-codestyle-0.9.7</tag>
    </scm>

    <!--
    ################################################
    # Section 5:  Profiles
    ################################################
    -->
    <profiles>

        <profile>
            <id>jdk8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>

            <properties>

                <!-- Include Dokka -->
                <dokka.version>0.9.18</dokka.version>
                <dokka.outputFormat>javadoc</dokka.outputFormat>
            </properties>

            <build>
                <pluginManagement>
                    <plugins>

                        <!--
                            Dokka Maven Plugin provides javadoc-a-like documentation for Kotlin classes.
                            This plugin only works with JDK8, though, since it depends on the tools.jar
                            for its execution.
                        -->
                        <plugin>
                            <groupId>org.jetbrains.dokka</groupId>
                            <artifactId>dokka-maven-plugin</artifactId>
                            <version>${dokka.version}</version>
                            <configuration>
                                <outputDir>${project.reporting.outputDirectory}/dokka</outputDir>
                                <outputFormat>${dokka.outputFormat}</outputFormat>
                                <jdkVersion>8</jdkVersion>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>

                <plugins>

                    <!--
                        Dokka Maven Plugin provides javadoc-a-like documentation for Kotlin classes.
                        This plugin only works with JDK8, though, since it depends on the tools.jar
                        for its execution.
                    -->
                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>${dokka.version}</version>
                        <executions>
                            <execution>
                                <phase>pre-site</phase>
                                <goals>
                                    <goal>dokka</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>

        </profile>

        <!--
            Release profile for Nazgul Reactors.
        -->
        <profile>
            <id>jguru-release</id>
            <build>
                <plugins>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default-jar-no-fork</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <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>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <configuration>
                            <updateReleaseInfo>true</updateReleaseInfo>
                        </configuration>
                        <executions>
                            <execution>
                                <id>default-deploy</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>deploy-to-repo</id>
                                <goals>
                                    <goal>deploy</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>