<?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>org.pbinitiative</groupId>
    <artifactId>zenbpm-java-client</artifactId>
    <version>1.3.0</version>
    <packaging>pom</packaging>

    <name>ZenBPM Java Client</name>
    <description>Spring Boot starter and core REST/gRPC client for the ZenBPM process engine.</description>
    <url>https://github.com/pbinitiative/zenbpm-java-client</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/licenses/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>pbinitiative</name>
            <url>https://github.com/pbinitiative</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/pbinitiative/zenbpm-java-client.git</connection>
        <developerConnection>scm:git:https://github.com/pbinitiative/zenbpm-java-client.git</developerConnection>
        <url>https://github.com/pbinitiative/zenbpm-java-client</url>
    </scm>

    <modules>
        <module>zenbpm-client-core</module>
        <module>zenbpm-spring-boot-starter</module>
    </modules>

    <properties>
        <java.version>8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
        <gpg.skip>true</gpg.skip>
    </properties>

    <build>
        <plugins>
            <!-- Sources JAR — required by Maven Central -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Javadoc JAR — required by Maven Central -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <doclint>none</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- GPG signing — required by Maven Central.
                 Skipped by default; enable with -Dgpg.skip=false (used in CI release workflow). -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <skip>${gpg.skip}</skip>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

    <!--
      Release profile: enables deployment to Sonatype Central Portal
      (https://central.sonatype.com). Activated by `mvn deploy -P release`.
      Replaces the legacy nexus-staging-maven-plugin / s01.oss.sonatype.org path,
      which reached end-of-life on 2025-06-30.
    -->
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                            <waitUntil>published</waitUntil>
                            <deploymentName>zenbpm-java-client-${project.version}</deploymentName>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
