<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>4.1.0</version>
        <relativePath/>
    </parent>

    <groupId>ke.co.xently</groupId>
    <artifactId>http-logger-spring-boot-parent</artifactId>
    <version>1.2.0</version>
    <name>http-logger-spring-boot-parent</name>
    <description>Spring Boot autoconfiguration starter that adds request timing header</description>
    <url>https://github.com/xently/http-logger-spring-boot-starter</url>

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

    <developers>
        <developer>
            <name>Xently</name>
            <email>developers@xently.co.ke</email>
            <organization>Xently</organization>
            <organizationUrl>https://xently.co.ke</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/xently/http-logger-spring-boot-starter.git</connection>
        <developerConnection>scm:git:ssh://github.com:xently/http-logger-spring-boot-starter.git
        </developerConnection>
        <url>https://github.com/xently/http-logger-spring-boot-starter/tree/main</url>
    </scm>

    <packaging>pom</packaging>

    <properties>
        <java.version>21</java.version>
        <kover.version>0.9.8</kover.version>
        <!-- Set to false: The Parent POM must be published for children to be valid on Maven Central -->
        <maven.deploy.skip>false</maven.deploy.skip>
    </properties>

    <modules>
        <module>demo-webmvc</module>
        <module>demo-webflux</module>
        <module>http-logger-spring-boot-starter</module>
        <module>report-aggregate</module>
    </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.jetbrains.kotlinx</groupId>
                    <artifactId>kover-maven-plugin</artifactId>
                    <version>${kover.version}</version>
                    <executions>
                        <execution>
                            <id>instr</id>
                            <goals>
                                <goal>instrumentation</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlinx</groupId>
                <artifactId>kover-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.sonatype.central</groupId>
                            <artifactId>central-publishing-maven-plugin</artifactId>
                            <version>0.11.0</version>
                            <extensions>true</extensions>
                            <configuration>
                                <publishingServerId>central-publish</publishingServerId>
                                <autoPublish>true</autoPublish>
                                <waitUntil>published</waitUntil>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.4.0</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.12.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <doclint>none</doclint>
                            <failOnError>false</failOnError>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Execute publishing for the root POM itself -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <!-- CRITICAL: Stops the plugin from automatically trying to publish children -->
                        <inherited>false</inherited>
                        <configuration>
                            <skipPublishing>false</skipPublishing>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
