<?xml version='1.0' encoding='UTF-8'?>
<!--
  ~ Copyright (c) jGuru Europe AB.
  ~ All rights reserved.
  -->

<!--suppress MavenRedundantGroupId -->
<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.poms.kotlin</groupId>
    <artifactId>jguru-codestyle-kotlin-internal-parent</artifactId>
    <version>0.11.0</version>
    <name>${project.artifactId}</name>
    <packaging>pom</packaging>
    <url>${site.top.url}/${path.in.reactor}</url>
    <description>jGuru Codestyle: Kotlin Internal Parent (${project.packaging}, version ${project.version})</description>
    <inceptionYear>2018</inceptionYear>

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

    <licenses>
        <license>
            <name>jGuru Europe Corporate Source License, based on The Apache Software License, Version 2.0</name>
            <url>https://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>poms/kotlin/kotlin-internal-parent</path.in.reactor>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- Kotlin constants -->
        <kotlin.version>1.4.10</kotlin.version>
        <kotlin.jvm.target>1.8</kotlin.jvm.target>
        <kotlin.compiler.languageVersion>1.3</kotlin.compiler.languageVersion>
        <kotlin.compiler.apiVersion>1.3</kotlin.compiler.apiVersion>

        <!--
            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.6.1</maven.version>
        <jdk.version>1.8</jdk.version>
        <javaee-api.version>8.0.1</javaee-api.version>
        <validation-api.version>2.0.1.Final</validation-api.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>

        <!-- Commonly controlled version properties -->
        <aspectj.runtime.version>1.9.6</aspectj.runtime.version>
        <aspectj-maven-plugin.version>1.11</aspectj-maven-plugin.version>
        <jaxb-api.version>2.3.1</jaxb-api.version>
        <jaxb2-maven-plugin.version>2.5.0</jaxb2-maven-plugin.version>
        <osgi.version>6.0.0</osgi.version>
        <slf4j.version>1.7.25</slf4j.version>
        <logback.version>1.2.3</logback.version>
        <xmlunit.version>2.7.0</xmlunit.version>
        <depgraph-maven-plugin.version>3.3.0</depgraph-maven-plugin.version>
        <depgraph.printStyleConfiguration>false</depgraph.printStyleConfiguration>
        <jandex.plugin.version>1.0.8</jandex.plugin.version>
        <jandex.version>2.1.3.Final</jandex.version>

        <!-- Code style properties -->
        <maven-bundle-plugin.version>4.2.1</maven-bundle-plugin.version>
        <dependency.plugin.version>3.1.2</dependency.plugin.version>
        <pmd.plugin.version>3.12.0</pmd.plugin.version>
        <clover.plugin.version>4.2.1</clover.plugin.version>
        <spotbugs.plugin.version>4.1.4</spotbugs.plugin.version>
        <checkstyle.plugin.version>3.1.1</checkstyle.plugin.version>
        <checkstyle.header.java.file>codestyle/copyright/header_java.txt</checkstyle.header.java.file>
        <clean.plugin.version>3.1.0</clean.plugin.version>

        <!-- Surefire configuration parameters. -->
        <surefire.memconf>-Xmx1024m</surefire.memconf>
        <surefire.argLine>${surefire.memconf}</surefire.argLine>
        <surefire.plugin.version>2.22.1</surefire.plugin.version>

        <!-- OWASP configuration parameters. -->
        <owasp.suppressionFile>codestyle/owasp-suppression.xml</owasp.suppressionFile>
        <owasp.failOnError>false</owasp.failOnError>
        <owasp-dependency-check.version>6.0.2</owasp-dependency-check.version>

        <!-- Site plugin properties -->
        <maven-site-plugin.version>3.9.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.8.1</versions-maven-plugin.version>
        <dokka.version>1.4.10.2</dokka.version>
        <scm.provider.version>1.11.2</scm.provider.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    </properties>

    <repositories>
        <repository>
            <id>jcenter</id>
            <url>https://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>https://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>https://www.jguru.se</organizationUrl>
            <timezone>+1</timezone>
        </developer>
    </developers>

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

            <!--
                Logging framework
            -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
                <scope>test</scope>
            </dependency>

            <!--
                Kotlin dependencies
            -->
            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-bom</artifactId>
                <version>${kotlin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!--
            Always have the Codestyle Annotations available.
        -->
        <dependency>
            <groupId>se.jguru.codestyle.annotations</groupId>
            <artifactId>jguru-codestyle-annotations</artifactId>
            <version>0.11.0</version>
        </dependency>
    </dependencies>

    <!--
    ################################################
    # Section 3:  Build settings
    ################################################
    -->
    <build>
        <!-- We use kotlin only here. -->
        <sourceDirectory>src/main/kotlin</sourceDirectory>
        <testSourceDirectory>src/test/kotlin</testSourceDirectory>

        <pluginManagement>
            <plugins>

                <!--
                    Configures the WAR plugin to properly use the generated OSGi-compliant manifest.

                    Why:  Assigns some manifest data within the WARs in WAR projects. Reads bundle-generated manifest.
                    Used: Standard lifecycle, mvn package.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>3.2.3</version>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                            <manifestEntries>
                                <name>${project.name}</name>
                                <description>${project.description}</description>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>

                <!--
                    Creates a Jandex index.

                    Why:  Create additional metadata, and be Quarkus compliant.
                    Used: Default lifecycle, mvn process-classes.
                -->
                <plugin>
                    <groupId>org.jboss.jandex</groupId>
                    <artifactId>jandex-maven-plugin</artifactId>
                    <version>${jandex.plugin.version}</version>
                </plugin>

                <!--
                    Use the latest maven-clean-plugin.

                    Why:  Override the version in Maven's super pom.xml.
                    Used: Clean lifecycle
                -->
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${clean.plugin.version}</version>
                    <configuration>
                        <excludeDefaultDirectories>true</excludeDefaultDirectories>
                        <filesets>
                            <fileset>
                                <directory>${project.build.directory}</directory>
                                <excludes>
                                    <exclude>generated-resources/eclipse/**</exclude>
                                </excludes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>

                <!--
                    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.2.1</version>
                </plugin>

                <!--
                    Use the latest maven-assembly-plugin.

                    Why:  Override the version in Maven's super pom.xml.
                    Used: Assembly
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>

                <!--
                    Dependency graph generation plugin
                -->
                <plugin>
                    <groupId>com.github.ferstl</groupId>
                    <artifactId>depgraph-maven-plugin</artifactId>
                    <version>${depgraph-maven-plugin.version}</version>
                    <configuration>
                        <outputDirectory>${project.build.directory}/site/images</outputDirectory>
                        <outputFileName>dependency_graph</outputFileName>
                        <createImage>true</createImage>
                        <dotExecutable>${path.to.dot}</dotExecutable>
                        <showConflicts>true</showConflicts>
                        <showGroupIds>true</showGroupIds>
                        <showVersions>true</showVersions>
                        <printStyleConfiguration>${depgraph.printStyleConfiguration}</printStyleConfiguration>
                        <customStyleConfiguration>classpath:codestyle/depgraph-config.json</customStyleConfiguration>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>se.jguru.codestyle</groupId>
                            <artifactId>jguru-codestyle</artifactId>
                            <version>0.11.0</version>
                        </dependency>
                    </dependencies>
                </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>

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

                <!--
                    Ensure that the kotlin-maven-plugin uses the standard src/main/kotlin
                    and src/test/kotlin directories.

                    Why:  Ensures standard placement for Kotlin sources.
                    Used: Standard lifecycle, mvn compile / test-compile.
                -->
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${kotlin.version}</version>
                    <configuration>
                        <compilerPlugins>
                            <plugin>all-open</plugin>
                            <plugin>spring</plugin>
                            <plugin>no-arg</plugin>
                            <plugin>jpa</plugin>
                            <plugin>sam-with-receiver</plugin>
                        </compilerPlugins>
                        <pluginOptions>
                            <option>all-open:annotation=se.jguru.codestyle.annotations.UseOpenMembers</option>
                            <option>no-arg:annotation=se.jguru.codestyle.annotations.AddDefaultConstructor</option>
                            <option>spring:annotation=se.jguru.codestyle.annotations.UsesSpringFramework</option>
                            <option>sam-with-receiver:annotation=se.jguru.codestyle.annotations.ReceiverIsThisInSingleAbstractMethod</option>
                            <!-- Call instance initializers in the synthetic constructor -->
                            <option>no-arg:invokeInitializers=true</option>
                        </pluginOptions>
                        <languageVersion>${kotlin.compiler.languageVersion}</languageVersion>
                        <apiVersion>${kotlin.compiler.apiVersion}</apiVersion>
                        <jvmTarget>${jdk.version}</jvmTarget>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.jetbrains.kotlin</groupId>
                            <artifactId>kotlin-maven-noarg</artifactId>
                            <version>${kotlin.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.jetbrains.kotlin</groupId>
                            <artifactId>kotlin-maven-allopen</artifactId>
                            <version>${kotlin.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.jetbrains.kotlin</groupId>
                            <artifactId>kotlin-maven-sam-with-receiver</artifactId>
                            <version>${kotlin.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>se.jguru.codestyle.annotations</groupId>
                            <artifactId>jguru-codestyle-annotations</artifactId>
                            <version>0.11.0</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <!--
                    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>
                        <dokkaPlugins>
                            <plugin>
                                <groupId>org.jetbrains.dokka</groupId>
                                <artifactId>kotlin-as-java-plugin</artifactId>
                                <version>${dokka.version}</version>
                            </plugin>
                        </dokkaPlugins>
                        <outputDir>${project.reporting.outputDirectory}/dokka</outputDir>
                        <jdkVersion>8</jdkVersion>
                        <noStdlibLink>true</noStdlibLink>
                        <noJdkLink>true</noJdkLink>
                    </configuration>
                </plugin>

                <!--
                    Define the version of the Surefire plugin

                    Why:  Ensure we have a recent enough surefire to use parallellism properly
                    When: Standard lifecycle, test phase
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.0</version>
                    <configuration>
                        <encoding>UTF-8</encoding>
                        <argLine>${surefire.argLine}</argLine>
                        <parallelOptimized>true</parallelOptimized>
                        <workingDirectory>${basedir}/target/FORK_DIRECTORY_${surefire.forkNumber}</workingDirectory>
                        <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    </configuration>
                </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>${maven-bundle-plugin.version}</version>
                    <configuration>
                        <supportedProjectTypes>
                            <supportedProjectType>ejb</supportedProjectType>
                            <supportedProjectType>jar</supportedProjectType>
                            <supportedProjectType>bundle</supportedProjectType>
                            <supportedProjectType>war</supportedProjectType>
                            <supportedProjectType>ear</supportedProjectType>
                        </supportedProjectTypes>
                        <instructions>
                            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                            <Embed-Directory>osgi/embedded</Embed-Directory>
                            <_consumer-policy><![CDATA[$<range;[===,+)>]]></_consumer-policy>
                            <_provider-policy><![CDATA[$<range;[===,=+)>]]></_provider-policy>
                        </instructions>
                    </configuration>
                </plugin>

                <!--
                    Generate maven dependencies listing file
                 -->
                <plugin>
                    <groupId>org.apache.servicemix.tooling</groupId>
                    <artifactId>depends-maven-plugin</artifactId>
                    <version>1.4.0</version>
                </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>
                </plugin>

                <!--
                    Specify the version of the Deploy plugin

                    Why:  Used to deploy artifacts to repositories.
                    Used: To copy/upload artifacts to repos.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven-deploy-plugin.version}</version>
                    <configuration>
                        <updateReleaseInfo>true</updateReleaseInfo>
                    </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>
                    <executions>
                        <execution>
                            <id>default-deploy</id>
                            <phase>none</phase>
                        </execution>
                    </executions>
                </plugin>

                <!--
                    Use the latest jaxb2-maven-plugin to provide XSD generation abilities.

                    Why: To enable XML-to-Java and Java-to-XML code generation
                    Used: in Model projects, as inserted.
                -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxb2-maven-plugin</artifactId>
                    <version>${jaxb2-maven-plugin.version}</version>
                    <configuration>
                        <outputDirectory>${project.build.directory}/jaxb2/transformed/generated-schema</outputDirectory>
                        <transformSchemas>
                            <!--
                                Each schema element defines:

                                a) A <<namespace uri>> for one of your namespaces.
                                   This namespace uri must be unique within the schemas element.

                                b) A <<toPrefix>> that you want to use for the namespace.
                                   Should not contain whitespace or exotic characters.
                                   This yields a namespace definition on the form
                                   <xs:schema ... xmlns:[toPrefix]="[uri]" ... />

                                   (I.e: <xs:schema ... xmlns:some="http://some/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema"> )

                                   ... and transforms relevant xml schema elements to use the provided namespace prefix:

                                   <some:elementName ... />

                                c) The desired <<toFile>> name of the generated XML schema definition file,
                                   excluding the ".xsd" suffix (which will be added automatically).
                            -->
                            <transformSchema>
                                <uri>https://www.jguru.se/nazgul/core</uri>
                                <toFile>NazgulCore.xsd</toFile>
                            </transformSchema>
                        </transformSchemas>
                    </configuration>
                </plugin>

                <!--
                    Perform a shallow security analysis check on dependencies.

                    Why: To avoid using the most obvious compromised dependencies.
                    Used: in every project, as inserted.
                -->
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>${owasp-dependency-check.version}</version>
                    <configuration>
                        <suppressionFiles>
                            <suppressionFile>${owasp.suppressionFile}</suppressionFile>
                        </suppressionFiles>
                        <failOnError>${owasp.failOnError}</failOnError>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>se.jguru.codestyle</groupId>
                            <artifactId>jguru-codestyle</artifactId>
                            <version>0.11.0</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <!--
                    Defines the mechanics for Maven artifact installation.

                    Why:  Plugin used to copy artifacts into the local M2 repository.
                    Used: In all projects; install phase.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${maven-install-plugin.version}</version>
                    <configuration>
                        <createChecksum>true</createChecksum>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>

        <plugins>

            <!--
                 Ensure that the kotlin-maven-plugin uses the standard src/main/kotlin
                 and src/test/kotlin directories.

                 Why:  Ensures standard placement for Kotlin sources.
                 Used: Standard lifecycle, mvn compile / test-compile.
             -->
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--
                Creates a Jandex index.

                Why:  Create additional metadata, and be Quarkus compliant.
                Used: Default lifecycle, mvn process-classes.
            -->
            <plugin>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>${jandex.plugin.version}</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>

                <dependencies>
                    <!--
                        To avoid problems, the Jandex jar version must match
                        the version found within the runtime used.
                        For example, this applies to the Wildfly application server.
                    -->
                    <dependency>
                        <groupId>org.jboss</groupId>
                        <artifactId>jandex</artifactId>
                        <version>${jandex.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--
                Ensure that the compiler plugin ignores the Java directories.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <executions>
                    <!--
                        Replacing default-compile as it is treated specially by maven
                     -->
                    <execution>
                        <id>default-compile</id>
                        <phase>none</phase>
                    </execution>
                    <!--
                        Replacing default-testCompile as it is treated specially by maven
                     -->
                    <execution>
                        <id>default-testCompile</id>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>java-compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <!-- configuration>
                            <compileSourceRoots>
                                <sourceRoot>src/main/java</sourceRoot>
                                <sourceRoot>src/main/kotlin</sourceRoot>
                            </compileSourceRoots>
                        </configuration -->
                    </execution>
                    <execution>
                        <id>java-test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                        <!-- configuration>
                            <compileSourceRoots>
                                <sourceRoot>src/main/java</sourceRoot>
                                <sourceRoot>src/main/kotlin</sourceRoot>
                            </compileSourceRoots>
                        </configuration -->
                    </execution>
                </executions>
            </plugin>

            <!--
                Provides Plantuml integration into site deployments.

                Why:  Convert Plantuml (*.puml) documents to png images, for use in site documentation.
                Used: Site lifecycle, mvn site.
            -->
            <plugin>
                <groupId>com.github.jeluard</groupId>
                <artifactId>plantuml-maven-plugin</artifactId>
                <version>7954</version>
                <configuration>
                    <sourceFiles>
                        <directory>${basedir}</directory>
                        <includes>
                            <include>src/site/**/*.puml</include>
                        </includes>
                    </sourceFiles>
                    <outputDirectory>${project.build.directory}/site/images/plantuml</outputDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>generate-plantuml-diagrams</id>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <phase>pre-site</phase>
                    </execution>
                </executions>
                <dependencies>
                    <!--
                        NOTE!

                        Do not upgrade the plantuml dependency above version 8030, as those plantuml releases
                        are not binary compatible with the plugin version 7954.
                    -->
                    <dependency>
                        <groupId>net.sourceforge.plantuml</groupId>
                        <artifactId>plantuml</artifactId>
                        <version>8030</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--
                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>
                        <phase>package</phase>
                        <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>

            <!--
                Generate maven dependencies listing file

                Used: Standard lifecycle, mvn compile.
            -->
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                    </execution>
                </executions>
            </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>${maven-release-plugin.version}</version>
                <configuration>
                    <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>

            <!--
                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>3.3.0</version>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!--
                Dokka Maven Plugin provides javadoc-a-like documentation for Kotlin classes.
            -->
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>CreateJavaDocForSite</id>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>dokka</goal>
                            <goal>javadoc</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Generate dependency graph -->
            <plugin>
                <groupId>com.github.ferstl</groupId>
                <artifactId>depgraph-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-dependency-graph-image</id>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>graph</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Analyze dependencies for trivial security flaws -->
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </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-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>

            <!--
                Supply an aggregate report of the OWASP dependency check.

                Why:  Incitament to upgrade problematic dependencies.
                Used: Maven site
            -->
            <plugin>
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </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>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>ossrh-snapshots</id>
            <name>Sonatype OSS Nexus: Snapshots</name>
            <url>https://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.11.1</tag>
    </scm>

    <!--
    ################################################
    # Section 5:  Profiles
    ################################################
    -->
    <profiles>
        <profile>
            <id>jdk9</id>
            <activation>
                <jdk>[9,11)</jdk>
            </activation>

            <properties>
                <surefire.fullArgLine>--add-modules java.xml.bind
                    --illegal-access=deny</surefire.fullArgLine>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <compilerArgs>
                                <arg>--add-modules=java.xml.bind</arg>
                            </compilerArgs>
                            <!-- without forking compilation happens in the
                                same process, so no arguments are applied -->
                            <fork>true</fork>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>${surefire.fullArgLine}</argLine>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <argLine>${surefire.fullArgLine}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

        </profile>

        <profile>
            <id>jdk11</id>
            <activation>
                <jdk>[11,)</jdk>
            </activation>

            <properties>
                <surefire.fullArgLine>--illegal-access=permit</surefire.fullArgLine>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <!--
                                without forking compilation happens in the
                                same process, so no arguments are applied
                             -->
                            <fork>true</fork>
                        </configuration>
                    </plugin>

                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>${surefire.fullArgLine}</argLine>
                        </configuration>
                    </plugin>

                    <!-- plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>3.0.0-M3</version>
                        <configuration>
                            <includesFile>*/it/*</includesFile>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</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>
                        <version>3.2.0</version>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <version>${dokka.version}</version>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>dokka</goal>
                                    <goal>javadoc</goal>
                                    <goal>javadocJar</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>
                        <version>${maven-deploy-plugin.version}</version>
                        <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>