<?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>ai.aletyx.kogito</groupId>
  <artifactId>aletyx-kogito-ai-parent</artifactId>
  <version>0.2.0</version>
  <packaging>pom</packaging>

  <name>Aletyx Kogito AI Add-ons (Parent)</name>
  <description>GenAI add-ons for Kogito (Apache KIE), by Aletyx. Ships the Ad-Hoc Subprocess add-on today, with additional add-ons planned.</description>
  <url>https://github.com/aletyx/aletyx-kogito-ai-addons</url>
  <inceptionYear>2026</inceptionYear>

  <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>

  <organization>
    <name>Aletyx, Inc.</name>
    <url>https://aletyx.ai/</url>
  </organization>

  <developers>
    <developer>
      <id>aletyx</id>
      <name>Aletyx Engineering</name>
      <email>opensource@aletyx.ai</email>
      <organization>Aletyx, Inc.</organization>
      <organizationUrl>https://aletyx.ai/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/aletyx/aletyx-kogito-ai-addons.git</connection>
    <developerConnection>scm:git:git@github.com:aletyx/aletyx-kogito-ai-addons.git</developerConnection>
    <url>https://github.com/aletyx/aletyx-kogito-ai-addons</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/aletyx/aletyx-kogito-ai-addons/issues</url>
  </issueManagement>

  <modules>
    <module>aletyx-kogito-ai-build-parent</module>
    <module>aletyx-kogito-ai-bom</module>
    <module>aletyx-kogito-ai-adhoc-subprocess-parent</module>
  </modules>

  <profiles>
    <!--
      Release profile — activate with `-Prelease` on `mvn deploy`.
      Adds source + javadoc jars, PGP-signs every artifact, and uploads
      to the Maven Central Portal (https://central.sonatype.com).
      Idle by default so day-to-day `./mvnw install` doesn't need GPG
      keys, javadoc, or Sonatype credentials.

      Prerequisites for a maintainer cutting a release:
        - GPG key whose public counterpart is on a public keyserver
          (default keyservers.openpgp.org). Set GPG_KEY_ID env var so
          the right key is selected when more than one is in the keyring.
        - Sonatype Central token in ~/.m2/settings.xml under <server id="central">.
        - The version is set to a non-SNAPSHOT (e.g. 1.0.0).

      See docs/releasing.md for the full maintainer flow.
    -->
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <!-- Don't fail the release on javadoc lint warnings;
                       Maven Central just needs the jar to exist and
                       open. -->
                  <doclint>none</doclint>
                  <quiet>true</quiet>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <!-- gpg.keyname: env var (e.g. fingerprint or key id)
                       picks one specific key when the maintainer's
                       keyring has several. Optional if there's only one
                       private key. -->
                  <keyname>${env.GPG_KEY_ID}</keyname>
                  <!-- maven-gpg-plugin 3.x doesn't read GPG_PASSPHRASE
                       implicitly. Naming the env var here lets the
                       plugin pull the passphrase out of the maintainer's
                       shell and feed it to gpg over a private fd, so
                       signing works unattended (CI, scripted release).
                       Combined with the loopback pinentry-mode argument
                       below, gpg won't fall back to a pinentry binary. -->
                  <passphraseEnvName>GPG_PASSPHRASE</passphraseEnvName>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <!-- Server id matches the <server id="central"> entry in
                   the maintainer's ~/.m2/settings.xml that holds the
                   Sonatype token (username + password from
                   https://central.sonatype.com/account → Generate User
                   Token). -->
              <publishingServerId>central</publishingServerId>
              <!-- autoPublish=false drops artifacts in the staging area
                   so the maintainer can review on the portal before
                   pressing "Publish". Set to true to skip the manual
                   gate once you trust the pipeline. -->
              <autoPublish>false</autoPublish>
              <waitUntil>uploaded</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
