<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>net.unit8.raoh</groupId>
    <artifactId>raoh-parent</artifactId>
    <version>0.7.2</version>
    <packaging>pom</packaging>

    <name>Raoh Parent</name>
    <description>Parse don't validate - A Java decoder library</description>
    <url>https://github.com/kawasima/raoh</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/kawasima/raoh</url>
        <connection>scm:git:git://github.com/kawasima/raoh.git</connection>
        <developerConnection>scm:git:git@github.com:kawasima/raoh.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <id>kawasima</id>
            <name>Yoshitaka Kawashima</name>
            <email>kawasima1016@gmail.com</email>
        </developer>
    </developers>

    <modules>
        <module>raoh</module>
        <module>raoh-json</module>
        <module>raoh-jooq</module>
        <module>raoh-gsh</module>
        <module>raoh-gsh-weaver</module>
        <module>raoh-gsh-maven-plugin</module>
    </modules>

    <properties>
        <maven.compiler.source>25</maven.compiler.source>
        <maven.compiler.target>25</maven.compiler.target>
        <maven.compiler.release>25</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jackson.version>3.1.0</jackson.version>
        <junit.version>5.11.4</junit.version>
        <!--
            The release the published-API diff compares against. It stays on the previous
            release while a cycle is in flight — that is what makes the diff describe the
            cycle — and moves forward in step 7 of the release flow, together with the bump
            to the next SNAPSHOT. A baseline left behind makes the diff grow by a release
            at a time until it says nothing about the change in front of you.
        -->
        <japicmp.baseline>0.7.1</japicmp.baseline>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <!--
                    Pinned because raoh binds an extra copy-resources execution to it, which
                    decides what lands in the published jar. Left unpinned, the version comes
                    from whichever Maven distribution runs the build.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <!--
                    Integration tests run against the packaged jar rather than target/classes,
                    so a test can assert on what a consumer actually receives.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.5.2</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!--
                    Public API diff against the last release, for the library modules that
                    declare it (raoh, raoh-json, raoh-jooq). Reporting only: before 1.0 the
                    breaks are deliberate and frequent, and a build that fails on each one
                    turns the exclusion list into the thing you edit to get back to green —
                    which is the opposite of acknowledging a break. The report is what the
                    CHANGELOG's breaking-change list gets written from.

                    At 1.0, set both breakBuild* flags to true. From then on an intentional
                    break needs an explicit <exclude>, and that list is the acknowledgement.
                -->
                <plugin>
                    <groupId>com.github.siom79.japicmp</groupId>
                    <artifactId>japicmp-maven-plugin</artifactId>
                    <version>0.23.1</version>
                    <configuration>
                        <!--
                            Pinned to a released coordinate rather than LATEST/RELEASE, so the
                            comparison resolves from Central and does not depend on what happens
                            to be in the local repository.
                        -->
                        <oldVersion>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>${project.artifactId}</artifactId>
                                <version>${japicmp.baseline}</version>
                                <type>jar</type>
                            </dependency>
                        </oldVersion>
                        <parameter>
                            <onlyModified>true</onlyModified>
                            <!--
                                A dependent module's baseline was compiled against the baseline of
                                raoh, but the comparison runs with the current raoh on the classpath,
                                so a type this cycle removed cannot be resolved there. Ignore only
                                our own types: a break in raoh belongs to raoh's own report, while a
                                third-party classpath gap still fails loudly.
                            -->
                            <ignoreMissingClassesByRegularExpressions>
                                <ignoreMissingClassesByRegularExpression>net\.unit8\.raoh\..*</ignoreMissingClassesByRegularExpression>
                            </ignoreMissingClassesByRegularExpressions>
                            <breakBuildOnBinaryIncompatibleModifications>false</breakBuildOnBinaryIncompatibleModifications>
                            <breakBuildOnSourceIncompatibleModifications>false</breakBuildOnSourceIncompatibleModifications>
                        </parameter>
                    </configuration>
                    <executions>
                        <execution>
                            <id>api-diff</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>cmp</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.13.0</version>
                <configuration>
                    <release>25</release>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.5.2</version>
            </plugin>
            <!--
                Code coverage. 0.8.14+ is required for Java 25 (class file major version 69);
                older versions fail with "Unsupported class file major version 69". prepare-agent
                instruments the tests; report emits per-module HTML/XML under target/site/jacoco.
                Reporting only — no coverage thresholds enforced.
            -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.14</version>
                <executions>
                    <execution>
                        <id>jacoco-prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>jacoco-report</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.10.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>published</waitUntil>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</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.11.2</version>
                        <configuration>
                            <doclint>all</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <configuration>
                            <bestPractices>true</bestPractices>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
