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

    <!-- Maven coordinates used by consumers -->
    <groupId>ai.codekarma</groupId>
    <artifactId>codekarma-client-sdk-java</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <!-- Human-readable project metadata required by Maven Central -->
    <name>CodeKarma Client SDK Java</name>
    <description>Java client SDK for integrating applications with CodeKarma request lifecycle tracking.</description>
    <url>https://github.com/codekarma-tech/codekarma-client-sdk</url>

    <licenses>
        <license>
            <name>Proprietary</name>
            <url>https://github.com/codekarma-tech/codekarma-client-sdk/blob/main/LICENSE</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>CodeKarma Team</name>
            <organization>CodeKarma Technologies Private Limited</organization>
            <organizationUrl>https://codekarma.ai</organizationUrl>
        </developer>
    </developers>

    <!-- Source control metadata shown on Central and used for traceability -->
    <scm>
        <connection>scm:git:https://github.com/codekarma-tech/codekarma-client-sdk.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:codekarma-tech/codekarma-client-sdk.git</developerConnection>
        <url>https://github.com/codekarma-tech/codekarma-client-sdk</url>
    </scm>

    <properties>
        <!-- Java baseline for compiled artifacts -->
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <resources>
            <!-- Include Java package README in the published jar under META-INF -->
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>README_JAVA.md</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>

            <!-- Include repo-level README in the published jar under META-INF -->
            <resource>
                <directory>${project.basedir}/../</directory>
                <includes>
                    <include>README.md</include>
                </includes>
                <targetPath>META-INF</targetPath>
            </resource>

            <!-- Standard classpath resources -->
            <resource>
                <directory>${project.basedir}/src/main/resources</directory>
            </resource>
        </resources>

        <plugins>
            <!-- Required by Central: attach a -sources jar -->
            <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>

            <!-- Required by Central: attach a -javadoc jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.7.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Required by Central: cryptographically sign all published artifacts -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <gpgArguments>
                        <!-- Allows non-interactive signing in CI environments -->
                        <arg>--pinentry-mode</arg>
                        <arg>loopback</arg>
                    </gpgArguments>
                </configuration>
            </plugin>

            <!-- Central Portal publishing plugin (replaces legacy OSSRH staging flow) -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.9.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>published</waitUntil>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
