<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.craftercms.mariaDB4j</groupId>
        <artifactId>mariaDB4j-pom-lite</artifactId>
        <!-- Do NOT depend on a SNAPSHOT here!
             Note that this parent version and the version below are, intentionally, completely unrelated. -->
        <version>3.3.0.2</version>
        <relativePath>mariaDB4j-pom-lite/pom.xml</relativePath>
    </parent>

    <artifactId>mariaDB4j-pom</artifactId>
    <name>MariaDB4j POM</name>
    <version>3.3.0.2</version>
    <packaging>pom</packaging>

    <scm>
        <!-- The <connection> and <url> are specified in the <parent> but the
                 <developerConnection> and the <tag> must be here, for the maven-release-plugin
                 to work correctly, if the <parent> is not a SNAPSHOT;
                 see https://github.com/vorburger/MariaDB4j/issues/43.
             -->
        <developerConnection>scm:git:git@github.com:craftercms/MariaDB4j.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>mariaDB4j-pom-lite</module>
        <!-- <module>DBs</module> -->
        <module>mariaDB4j-core</module>
        <module>mariaDB4j-junit</module>
        <module>mariaDB4j</module>
        <module>mariaDB4j-app</module>
        <module>mariaDB4j-springboot</module>
        <module>mariaDB4j-maven-plugin</module>
    </modules>

    <properties>
        <!-- https://maven.apache.org/guides/mini/guide-reproducible-builds.html -->
        <project.build.outputTimestamp>2024-03-27T22:37:40Z</project.build.outputTimestamp>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <springframework.version>6.2.11</springframework.version>
        <springboot.version>3.5.6</springboot.version>
        <jakarta.annotation-api.version>3.0.0</jakarta.annotation-api.version>
        <errorprone.version>2.42.0</errorprone.version>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <snakeyaml.version>2.2</snakeyaml.version> <!-- Override the version defined by spring-boot -->
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.14.1</version>
                <configuration>
                    <release>21</release>
                    <encoding>UTF-8</encoding>
                    <compilerArgs>
                        <arg>-Werror</arg>
                        <arg>-Xlint:all</arg>
                        <arg>-XDcompilePolicy=simple</arg>
                        <arg>--should-stop=ifError=FLOW</arg>
                        <arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode
                            -Xep:IdentifierName:OFF -Xep:Java8ApiChecker:OFF
                            -XepExcludedPaths:.*/target/generated-sources/.*</arg>
                    </compilerArgs>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>com.google.errorprone</groupId>
                            <artifactId>error_prone_core</artifactId>
                            <version>${errorprone.version}</version>
                        </path>
                        <!-- Other annotation processors go here.
                             If 'annotationProcessorPaths' is set, processors will no longer be
                             discovered on the regular -classpath; see also 'Using Error Prone
                             together with other annotation processors' below. -->
                    </annotationProcessorPaths>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.4</version>
                <dependencies>
                    <!-- See https://github.com/MariaDB4j/MariaDB4j/issues/1150 -->
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>3.5.4</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>6.0.0</version>
                    </dependency>
                </dependencies>
            </plugin>

            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <configuration>
                    <quiet>true</quiet>
                    <show>public</show>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <!--https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven
                        http://jira.codehaus.org/browse/MGPG-9 & http://jira.codehaus.org/browse/MRELEASE-263 -->
                    <mavenExecutorId>forked-path</mavenExecutorId>
                    <!-- Following is required because artifactId is (now) mariaDB4j-pom, but we
                    want mariaDB4j -->
                    <tagNameFormat>mariaDB4j-@{project.version}</tagNameFormat>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.7.0</version>
                <configuration>
                    <licenseName>apache_v2</licenseName>
                    <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <roots>
                        <root>src/main/java</root>
                        <root>src/test/java</root>
                    </roots>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.spotify.fmt</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>2.29</version>
                <executions>
                    <execution>
                        <?m2e execute onIncremental?>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <style>aosp</style>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${springboot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <scope>test</scope>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <!-- See https://github.com/MariaDB4j/MariaDB4j/issues/1150 -->
                <version>4.13.2</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>2.0.17</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.20.0</version>
            </dependency>
            <dependency>
                <groupId>commons-dbutils</groupId>
                <artifactId>commons-dbutils</artifactId>
                <version>1.8.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${jakarta.annotation-api.version}</version>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
</project>
