<?xml version="1.0" encoding="UTF-8"?>
<!--
~   Licensed under the Apache License, Version 2.0 (the "License");
~   you may not use this file except in compliance with the License.
~   You may obtain a copy of the License at
~
~   http://www.apache.org/licenses/LICENSE-2.0
~
~   Unless required by applicable law or agreed to in writing, software
~   distributed under the License is distributed on an "AS IS" BASIS,
~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~   See the License for the specific language governing permissions and
~   limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>50</version>
        <!-- null out the relative path, otherwise maven complains that the referenced POM is not in the parent directory -->
        <relativePath />
    </parent>

    <groupId>org.jdbi.internal</groupId>
    <artifactId>jdbi3-build-parent</artifactId>
    <version>3.36.0</version>
    <packaging>pom</packaging>

    <name>jdbi3 - internal - build parent</name>
    <description>Jdbi3 build settings. This is a Jdbi internal module and not part of the public API.</description>

    <!-- do not remove URL and SCM, otherwise OSS refuses to accept the release -->
    <url>https://jdbi.org/</url>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>jdbi</id>
            <name>The Jdbi Team</name>
            <url>https://github.com/jdbi/jdbi/blob/master/CONTRIBUTORS.md</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/jdbi/jdbi.git</connection>
        <developerConnection>scm:git:git@github.com:jdbi/jdbi.git</developerConnection>
        <tag>v3.36.0</tag>
        <url>https://github.com/jdbi/jdbi/</url>
    </scm>

    <properties>
        <basepom.at-end.deploy>true</basepom.at-end.deploy>
        <basepom.check.fail-all>true</basepom.check.fail-all>
        <basepom.release.profiles>basepom.oss-release,jdbi-release</basepom.release.profiles>
        <basepom.release.tag-name-format>v@{project.version}</basepom.release.tag-name-format>
        <basepom.test.fork-count>4</basepom.test.fork-count>
        <basepom.test.timeout>240</basepom.test.timeout>

        <dep.antlr.version>4.10.1</dep.antlr.version>
        <dep.assertj-core.version>3.23.1</dep.assertj-core.version>
        <dep.assertj-guava.version>3.4.0</dep.assertj-guava.version>
        <dep.caffeine.version>3.0.3</dep.caffeine.version>
        <dep.commons-text.version>1.10.0</dep.commons-text.version>
        <dep.derby.version>10.15.2.0</dep.derby.version>
        <dep.detekt.version>1.21.0-RC2</dep.detekt.version>
        <dep.dokka.version>1.7.10</dep.dokka.version>
        <dep.flyway.version>7.15.0</dep.flyway.version>
        <dep.freebuilder.version>2.7.0</dep.freebuilder.version>
        <dep.guava.version>30.1.1-jre</dep.guava.version>
        <dep.h2.version>2.1.214</dep.h2.version>
        <!-- leave hikari-cp on 4.x for jdk8 compatibility! -->
        <dep.hikari-cp.version>4.0.3</dep.hikari-cp.version>
        <dep.hsqldb.version>2.7.1</dep.hsqldb.version>
        <dep.immutables.version>2.8.8</dep.immutables.version>
        <dep.jackson2.version>2.10.5.20201202</dep.jackson2.version>
        <dep.jdbi-policy.version>3.36.0</dep.jdbi-policy.version>
        <dep.jetbrainsAnnotations.version>21.0.1</dep.jetbrainsAnnotations.version>
        <dep.joda-time.version>2.9.9</dep.joda-time.version>
        <dep.jts.version>1.19.0</dep.jts.version>
        <dep.junit5.version>5.9.1</dep.junit5.version>
        <dep.kotlin.version>1.5.32</dep.kotlin.version>
        <dep.lombok.version>1.18.24</dep.lombok.version>
        <dep.mockito.version>4.2.0</dep.mockito.version>
        <dep.pg-embedded.version>4.2</dep.pg-embedded.version>
        <dep.plugin.asciidoctor.version>2.2.2</dep.plugin.asciidoctor.version>
        <dep.plugin.detekt.version>1.21.0.1</dep.plugin.detekt.version>
        <dep.plugin.flatten.version>1.3.0</dep.plugin.flatten.version>
        <dep.plugin.inline.version>1.0.1</dep.plugin.inline.version>
        <dep.plugin.kotlin.version>1.7.10</dep.plugin.kotlin.version>
        <dep.plugin.ktlint.version>1.15.1</dep.plugin.ktlint.version>
        <dep.plugin.sortpom.version>3.2.0</dep.plugin.sortpom.version>
        <dep.postgresql.version>42.5.1</dep.postgresql.version>
        <dep.slf4j.version>1.7.36</dep.slf4j.version>
        <dep.spring.version>5.3.20</dep.spring.version>
        <dep.testcontainers.version>1.17.6</dep.testcontainers.version>
        <dep.vavr.version>0.9.3</dep.vavr.version>
        <jdbi.check.fail-detekt>${jdbi.check.fail-kotlin}</jdbi.check.fail-detekt>
        <jdbi.check.fail-kotlin>${basepom.check.fail-extended}</jdbi.check.fail-kotlin>
        <jdbi.check.fail-ktlint>${jdbi.check.fail-kotlin}</jdbi.check.fail-ktlint>
        <jdbi.check.skip-detekt>${jdbi.check.skip-kotlin}</jdbi.check.skip-detekt>
        <jdbi.check.skip-kotlin>${basepom.check.skip-extended}</jdbi.check.skip-kotlin>
        <jdbi.check.skip-ktlint>${jdbi.check.skip-kotlin}</jdbi.check.skip-ktlint>
        <jdbi.check.skip-sortpom>${basepom.check.skip-basic}</jdbi.check.skip-sortpom>
        <kotlin.compiler.apiVersion>1.5</kotlin.compiler.apiVersion>
        <!-- remove the '1.' once we move past JDK8 compatibility -->
        <kotlin.compiler.jvmTarget>1.${project.build.targetJdk}</kotlin.compiler.jvmTarget>
        <kotlin.compiler.languageVersion>1.5</kotlin.compiler.languageVersion>
        <project.build.targetJdk>8</project.build.targetJdk>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${dep.jackson2.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${dep.junit5.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${dep.testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>io.leangen.geantyref</groupId>
                <artifactId>geantyref</artifactId>
                <version>1.3.13</version>
            </dependency>

            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${dep.guava.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.checkerframework</groupId>
                        <artifactId>checker-qual</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>com.google.inject</groupId>
                <artifactId>guice</artifactId>
                <version>5.0.1</version>
            </dependency>

            <dependency>
                <groupId>com.github.ben-manes.caffeine</groupId>
                <artifactId>caffeine</artifactId>
                <version>${dep.caffeine.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.google.errorprone</groupId>
                        <artifactId>error_prone_annotations</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.checkerframework</groupId>
                        <artifactId>checker-qual</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>io.vavr</groupId>
                <artifactId>vavr</artifactId>
                <version>${dep.vavr.version}</version>
            </dependency>

            <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>antlr4-runtime</artifactId>
                <version>${dep.antlr.version}</version>
            </dependency>

            <dependency>
                <groupId>org.immutables</groupId>
                <artifactId>value</artifactId>
                <version>${dep.immutables.version}</version>
            </dependency>

            <dependency>
                <groupId>org.inferred</groupId>
                <artifactId>freebuilder</artifactId>
                <version>${dep.freebuilder.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${dep.spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
                <version>${dep.spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-jdbc</artifactId>
                <version>${dep.spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-tx</artifactId>
                <version>${dep.spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
                <version>${dep.spring.version}</version>
            </dependency>

            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-test</artifactId>
                <version>${dep.spring.version}</version>
            </dependency>

            <dependency>
                <groupId>com.google.code.gson</groupId>
                <artifactId>gson</artifactId>
                <version>2.9.0</version>
            </dependency>

            <dependency>
                <groupId>com.squareup.moshi</groupId>
                <artifactId>moshi</artifactId>
                <version>1.12.0</version>
            </dependency>

            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-core</artifactId>
                <version>${dep.flyway.version}</version>
            </dependency>

            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${dep.h2.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>${dep.hsqldb.version}</version>
            </dependency>

            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>${dep.postgresql.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.checkerframework</groupId>
                        <artifactId>checker-qual</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>org.apache.derby</groupId>
                <artifactId>derby</artifactId>
                <version>${dep.derby.version}</version>
            </dependency>

            <dependency>
                <groupId>org.locationtech.jts</groupId>
                <artifactId>jts-core</artifactId>
                <version>${dep.jts.version}</version>
            </dependency>

            <dependency>
                <groupId>com.opentable.components</groupId>
                <artifactId>otj-pg-embedded</artifactId>
                <version>1.0.1</version>
            </dependency>

            <dependency>
                <groupId>de.softwareforge.testing</groupId>
                <artifactId>pg-embedded</artifactId>
                <version>${dep.pg-embedded.version}</version>
            </dependency>

            <dependency>
                <groupId>org.tukaani</groupId>
                <artifactId>xz</artifactId>
                <version>1.9</version>
            </dependency>

            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${dep.lombok.version}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${dep.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${dep.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${dep.slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${dep.mockito.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${dep.mockito.version}</version>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${dep.assertj-core.version}</version>
            </dependency>

            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-guava</artifactId>
                <version>${dep.assertj-guava.version}</version>
            </dependency>

            <dependency>
                <groupId>com.squareup</groupId>
                <artifactId>javapoet</artifactId>
                <version>1.13.0</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains</groupId>
                <artifactId>annotations</artifactId>
                <version>${dep.jetbrainsAnnotations.version}</version>
            </dependency>

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

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

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-reflect</artifactId>
                <version>${dep.kotlin.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test</artifactId>
                <version>${dep.kotlin.version}</version>
            </dependency>

            <dependency>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-test-junit5</artifactId>
                <version>${dep.kotlin.version}</version>
            </dependency>

            <dependency>
                <groupId>com.nhaarman</groupId>
                <artifactId>mockito-kotlin</artifactId>
                <version>1.6.0</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${dep.commons-text.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.12.0</version>
            </dependency>

            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>1.21</version>
            </dependency>

            <dependency>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker-qual</artifactId>
                <version>3.15.0</version>
            </dependency>

            <dependency>
                <groupId>org.xerial</groupId>
                <artifactId>sqlite-jdbc</artifactId>
                <version>3.36.0.1</version>
            </dependency>

            <dependency>
                <groupId>org.antlr</groupId>
                <artifactId>ST4</artifactId>
                <version>4.3.1</version>
            </dependency>

            <dependency>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
                <version>1.3.2</version>
            </dependency>

            <dependency>
                <groupId>javax.persistence</groupId>
                <artifactId>persistence-api</artifactId>
                <version>1.0.2</version>
            </dependency>

            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>${dep.joda-time.version}</version>
            </dependency>

            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>2.3.31</version>
            </dependency>

            <dependency>
                <groupId>com.zaxxer</groupId>
                <artifactId>HikariCP</artifactId>
                <version>${dep.hikari-cp.version}</version>
                <exclusions>
                    <!-- excluded because it asks for 2.0.0 -->
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-api</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-annotations</artifactId>
                <version>${dep.spotbugs.version}</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>

            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.2</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
            <id>snapshots-repo</id>
            <name>Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
            <id>snapshots-repo</id>
            <name>Nexus Snapshots</name>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <layout>default</layout>
        </pluginRepository>
    </pluginRepositories>

    <build>

        <defaultGoal>clean verify</defaultGoal>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <configuration>
                        <excludes combine.children="append">
                            <exclude>src/build/*</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <configuration>
                        <excludePackageNames>*.internal.*:*.internal</excludePackageNames>
                        <links>
                            <link>https://google.github.io/guice/api-docs/4.0/javadoc/</link>
                            <link>https://javaee.github.io/javaee-spec/javadocs/</link>
                            <link>https://junit.org/junit5/docs/${dep.junit5.version}/api/</link>
                            <link>https://javadoc.io/doc/org.testcontainers/jdbc/${dep.testcontainers.version}/</link>
                        </links>
                        <nodeprecated>false</nodeprecated>
                        <author>false</author>
                        <detectJavaApiLink>true</detectJavaApiLink>
                        <nohelp>true</nohelp>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.dokka</groupId>
                    <artifactId>dokka-maven-plugin</artifactId>
                    <version>${dep.dokka.version}</version>
                    <configuration>
                        <jdkVersion>${project.build.targetJdk}</jdkVersion>
                        <skip>${basepom.javadoc.skip}</skip>
                        <perPackageOptions>
                            <packageOptions>
                                <matchingRegex>.*\.internal</matchingRegex>
                                <suppress>true</suppress>
                            </packageOptions>
                        </perPackageOptions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries combine.children="append">
                                <Automatic-Module-Name>${moduleName}</Automatic-Module-Name>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.antlr</groupId>
                    <artifactId>antlr4-maven-plugin</artifactId>
                    <version>${dep.antlr.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-maven-plugin</artifactId>
                    <version>${dep.plugin.kotlin.version}</version>
                    <configuration>
                        <jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.asciidoctor</groupId>
                    <artifactId>asciidoctor-maven-plugin</artifactId>
                    <version>${dep.plugin.asciidoctor.version}</version>
                </plugin>
                <plugin>
                    <groupId>com.github.ekryd.sortpom</groupId>
                    <artifactId>sortpom-maven-plugin</artifactId>
                    <version>${dep.plugin.sortpom.version}</version>
                    <configuration>
                        <skip>${jdbi.check.skip-sortpom}</skip>
                        <createBackupFile>false</createBackupFile>
                        <expandEmptyElements>false</expandEmptyElements>
                        <keepBlankLines>true</keepBlankLines>
                        <lineSeparator>\n</lineSeparator>
                        <nrOfIndentSpace>4</nrOfIndentSpace>
                        <sortDependencies>scope</sortDependencies>
                        <sortProperties>true</sortProperties>
                        <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
                        <predefinedSortOrder>recommended_2008_06</predefinedSortOrder>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.github.gantsign.maven</groupId>
                    <artifactId>ktlint-maven-plugin</artifactId>
                    <version>${dep.plugin.ktlint.version}</version>
                    <configuration>
                        <failOnViolation>${jdbi.check.fail-ktlint}</failOnViolation>
                        <skip>${jdbi.check.skip-ktlint}</skip>
                        <verbose>false</verbose>
                        <experimental>false</experimental>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.github.ozsie</groupId>
                    <artifactId>detekt-maven-plugin</artifactId>
                    <version>${dep.plugin.detekt.version}</version>

                    <configuration>
                        <skip>${jdbi.check.skip-detekt}</skip>
                        <jvmTarget>${kotlin.compiler.jvmTarget}</jvmTarget>
                        <failBuildOnMaxIssuesReached>${jdbi.check.fail-detekt}</failBuildOnMaxIssuesReached>
                        <configResource>policy/detekt.yml</configResource>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.jdbi.internal</groupId>
                            <artifactId>jdbi3-policy</artifactId>
                            <version>${dep.jdbi-policy.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>io.gitlab.arturbosch.detekt</groupId>
                            <artifactId>detekt-cli</artifactId>
                            <version>${dep.detekt.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <configuration>
                        <analysisCache>true</analysisCache>
                        <verbose>true</verbose>
                        <rulesets>
                            <ruleset>policy/pmd.xml</ruleset>
                        </rulesets>
                        <compileSourceRoots>${project.build.sourceDirectory}</compileSourceRoots>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.jdbi.internal</groupId>
                            <artifactId>jdbi3-policy</artifactId>
                            <version>${dep.jdbi-policy.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <configuration>
                        <configLocation>policy/checkstyle.xml</configLocation>
                        <suppressionsLocation>policy/checkstyle-suppress.xml</suppressionsLocation>
                        <sourceDirectories>${project.build.sourceDirectory},${project.build.testSourceDirectory}</sourceDirectories>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.jdbi.internal</groupId>
                            <artifactId>jdbi3-policy</artifactId>
                            <version>${dep.jdbi-policy.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <configuration>
                        <includeFilterFiles combine.children="override">
                            <includeFilterFile>policy/spotbugs-include.xml</includeFilterFile>
                        </includeFilterFiles>
                        <excludeFilterFiles combine.children="override">
                            <excludeFilterFile>policy/spotbugs-exclude.xml</excludeFilterFile>
                        </excludeFilterFiles>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.jdbi.internal</groupId>
                            <artifactId>jdbi3-policy</artifactId>
                            <version>${dep.jdbi-policy.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>${dep.plugin.flatten.version}</version>
                    <configuration>
                        <flattenMode>bom</flattenMode>
                        <pomElements>
                            <properties>remove</properties>
                            <distributionManagement>remove</distributionManagement>
                            <repositories>remove</repositories>
                            <dependencyManagement>interpolate</dependencyManagement>
                        </pomElements>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.basepom.maven</groupId>
                    <artifactId>inline-maven-plugin</artifactId>
                    <version>${dep.plugin.inline.version}</version>

                    <configuration>
                        <prefix>org.jdbi.v3.inlined</prefix>
                        <hideClasses>true</hideClasses>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.github.ekryd.sortpom</groupId>
                <artifactId>sortpom-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>sort</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-jdbi</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <!-- Ensure consistency -->
                                <dependencyConvergence />
                                <requireProperty>
                                    <property>moduleName</property>
                                    <message>This module must set a moduleName.</message>
                                </requireProperty>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Set a module name for the parent that is explicitly not inherited -->
        <profile>
            <id>in-parent</id>
            <activation>
                <file>
                    <exists>.jdbi-parent</exists>
                </file>
            </activation>
            <properties>
                <moduleName>org.jdbi.v3</moduleName>
            </properties>
        </profile>
        <profile>
            <id>maven-eclipse</id>
            <activation>
                <property>
                    <!-- see https://newbedev.com/get-rid-of-pom-not-found-warning-for-org-eclipse-m2e-lifecycle-mapping -->
                    <name>m2e.version</name>
                </property>
            </activation>
            <properties>
                <build.output>target-ide</build.output>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                        <plugin>
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.asciidoctor</groupId>
                                                <artifactId>asciidoctor-maven-plugin</artifactId>
                                                <versionRange>[1.5.3,)</versionRange>
                                                <goals>
                                                    <goal>process-asciidoc</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore />
                                            </action>
                                        </pluginExecution>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>com.github.ekryd.sortpom</groupId>
                                                <artifactId>sortpom-maven-plugin</artifactId>
                                                <versionRange>[0,)</versionRange>
                                                <goals>
                                                    <goal>sort</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore />
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>jdk8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <!-- last JDK 8 compatible versions -->
                <dep.caffeine.version>2.9.2</dep.caffeine.version>
                <dep.hsqldb.version>2.5.2</dep.hsqldb.version>
            </properties>
        </profile>
        <profile>
            <id>kotlin</id>
            <activation>
                <file>
                    <exists>${basedir}/src/main/kotlin</exists>
                </file>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.jetbrains</groupId>
                    <artifactId>annotations</artifactId>
                </dependency>

                <dependency>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-stdlib</artifactId>
                </dependency>

                <dependency>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-reflect</artifactId>
                </dependency>

                <dependency>
                    <groupId>org.jetbrains.kotlin</groupId>
                    <artifactId>kotlin-test</artifactId>
                    <scope>test</scope>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>kotlin</id>
                                <goals>
                                    <goal>add-source</goal>
                                </goals>
                                <phase>generate-sources</phase>
                                <configuration>
                                    <sources>
                                        <source>${project.basedir}/src/main/kotlin</source>
                                    </sources>
                                </configuration>
                            </execution>
                            <execution>
                                <id>test-kotlin</id>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <phase>generate-test-sources</phase>
                                <configuration>
                                    <sources>
                                        <source>${project.basedir}/src/test/kotlin</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>compile</id>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                            </execution>

                            <execution>
                                <id>test-compile</id>
                                <goals>
                                    <goal>test-compile</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <executions>
                            <!-- replace default compilations, to ensure kotlin runs before java -->
                            <execution>
                                <id>default-compile</id>
                                <phase>none</phase>
                            </execution>
                            <execution>
                                <id>default-testCompile</id>
                                <phase>none</phase>
                            </execution>
                            <!-- add new compilation executions for java -->
                            <execution>
                                <id>java-compile</id>
                                <goals>
                                    <goal>compile</goal>
                                </goals>
                                <phase>compile</phase>
                            </execution>
                            <execution>
                                <id>java-test-compile</id>
                                <goals>
                                    <goal>testCompile</goal>
                                </goals>
                                <phase>test-compile</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.jetbrains.dokka</groupId>
                        <artifactId>dokka-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>javadocJar</goal>
                                    <goal>dokka</goal>
                                </goals>
                                <phase>package</phase>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>com.github.gantsign.maven</groupId>
                        <artifactId>ktlint-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.ozsie</groupId>
                        <artifactId>detekt-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>default</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <phase>verify</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>jdbi-release</id>
            <properties>
                <basepom.check.skip-all>true</basepom.check.skip-all>
            </properties>

            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>enforce-java17</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <!-- releases must be built with Java 17 or better -->
                                        <requireJavaVersion>
                                            <version>[17,)</version>
                                        </requireJavaVersion>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <!-- Profile to skip time-consuming steps. -->
            <id>fast</id>
            <properties>
                <basepom.check.skip-all>true</basepom.check.skip-all>
                <skipITs>true</skipITs>
                <skipTests>true</skipTests>
            </properties>
        </profile>

    </profiles>
</project>
